Moinak Ghosh <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > [...] > >> Strictly conformant to the above would therefore be: > >> > >> #define dirfd(dp) ((dp) ? (dp)->dd_fd : -1) > >> > > > > No. Nothing to do with strictly conformant; while it is possible > > to have a DIR * which is NULL, using it immediately gets you undefined > > behaviour. > > > > IMHO, implementations MUST NOT protect against that; that way madness > > and buggy programs lie. > > > > As a related note glibc has some questionable protections, like > free(NULL)
See: http://www.opengroup.org/onlinepubs/009695399/functions/free.html This is allowed for orthogonality with realloc(NULL, size). Jörg -- EMail:[EMAIL PROTECTED] (home) Jörg Schilling D-13353 Berlin [EMAIL PROTECTED] (uni) [EMAIL PROTECTED] (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily _______________________________________________ opensolaris-discuss mailing list [email protected]
