difftime.c problem when HAVE_INCOMPATIBLE_CTIME_R on Solaris 8

Paul Eggert eggert at CS.UCLA.EDU
Mon Nov 8 23:32:43 UTC 2004

I ran into the following problem compiling the latest difftime.c on
Solaris 8 with GCC 3.4.2, compiling with CFLAGS='-g -O -Wall -W

  In file included from difftime.c:15:
  private.h:306: error: conflicting types for 'asctime_r'
  /usr/include/time.h:272: error: previous declaration of 'asctime_r' was here

I guess the problem is that sys/types.h brings in asctime_r before
private.h has a chance to munge it.  Here is a patch.

--- difftime.c	2004/11/01 18:33:49	2004.7
+++ difftime.c	2004/11/08 23:27:09
@@ -11,8 +11,7 @@ static char	elsieid[] = "@(#)difftime.c	
-#include "sys/types.h"	/* for time_t */
-#include "private.h"	/* for TYPE_INTEGRAL and TYPE_SIGNED */
+#include "private.h"	/* for time_t, TYPE_INTEGRAL and TYPE_SIGNED */
 difftime(time1, time0)

More information about the tz mailing list