[Patch] Fix type of clock_t in timevar.c

Mike Stump mikestump@comcast.net
Fri Nov 1 19:43:00 GMT 2013


On Nov 1, 2013, at 10:47 AM, Steve Ellcey <sellcey@mips.com> wrote:
> While working on a canadian cross build I ran into a problem with the
> type of clock_t.  If HAVE_CLOCK_T is not defined

> timevar.c defines it to be int.  I think the type should be long.  I am using the mingw
> compilers on linux in my canadian cross build and HAVE_CLOCK_T is not 
> getting set but when building I get a conflict between the definition
> of clock_t in /usr/i586-mingw32msvc/include/time.h (long) and the
> definition in timevar.c.

You should report a bug to them and have them define clock_t.

> Since mingw and linux and glibc and newlib all seem to agree on long
> I would like to change timevar.c to agree with them.

Seems reasonable to me, though newlib and macosx use unsigned long.  glibc remains at long, due to binary compatibility.


More information about the Gcc-patches mailing list