Inclusion of sys/types.h

Jeroen Ruigrok/asmodai asmodai at wxs.nl
Wed Jan 26 01:06:29 PST 2005


-On [20050126 09:32], Jeremy Messenger (mezz7 at xxxxxxx) wrote:
>I am maintaining for fluxbox-devel in FreeBSD and Jason has reported me
>about that DragonFly can't find the strftime() during the configure check
>that caused the clock disable in Fluxbox. All version of FreeBSD (include
>4.x) don't have any of problem. The code looks like this in the configure:
>
>==================================
>#include <time.h>
>int
>main ()
>{
>
>char * s;
>time_t t = time(NULL);
>size_t x = strftime(s, 5, "%a", localtime(&t));
>
>
>  ;
>  return 0;
>}
>==================================
>
>Jason has to add '#include <sys/types.h>' to fix this problem for
>DragonFly, but I am not sure if it's a bug in DragonFly or his system is
>broke. Two folks in IRC (#freebsd-gnome) said that time.h should be good
>enough for this as stated in the manpage in a link.

It should be and I am not happy with the change Matt made many months ago.

strftime() should return size_t, not __size_t, regardless if the type
definition ends up being the same anyway.  __ prefixed types are supposed to
be either internal ones, reserved ones or other special case types.

That's why

#ifdef  _BSD_SIZE_T_
typedef _BSD_SIZE_T_    size_t;
#undef  _BSD_SIZE_T_
#endif

was present in time.h before Matt ripped it out.

My suggestion is to put a size_t definition back into time.h and change the
return type back to what it should be per all specifications, i.e. size_t.

-- 
Jeroen Ruigrok van der Werven <asmodai(at)wxs.nl> / asmodai / kita no mono
Free Tibet! http://www.savetibet.org/ | http://ashemedai.deviantart.com/
http://www.tendra.org/   | http://www.in-nomine.org/
Love conquers all...





More information about the Bugs mailing list