Re: Inclusion of sys/types.h

看板DFBSD_bugs作者時間21年前 (2005/01/26 17:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串4/9 (看更多)
-On [20050126 09:32], Jeremy Messenger (mezz7@cox.net) 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...
文章代碼(AID): #11zsEP00 (DFBSD_bugs)
討論串 (同標題文章)
文章代碼(AID): #11zsEP00 (DFBSD_bugs)