Inclusion of sys/types.h

Jeremy Messenger mezz7 at cox.net
Wed Jan 26 00:23:06 PST 2005


On Wed, 26 Jan 2005 07:34:50 +0100, Jeroen Ruigrok/asmodai wrote:

> -On [20050126 07:32], Jason Porter (leporter at xxxxxxxxxxxx) wrote:
>>It seems that at least Fluxbox is assuming that size_t is available
>>without including sys/types.h
> 
> It can, but then you need to include <stddef.h> as per SUSv2.

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.

http://leaf.dragonflybsd.org/cgi/web-man?command=time&section=3

Cheers,
Mezz






More information about the Bugs mailing list