bsearch of empty array

Chris Dollin kers at hplb.hpl.hp.com
Thu May 16 21:20:21 AEST 1991


Doug Gwyn says (replying to my bsearch question):

   In general, when the C standard requires an argument to a library function
   to be a pointer to an array of XXX, it means it.  Null pointers are allowed
   only where specified.

Thanks, Doug. I don't like it (in the case I described), but I can live with
it. I've now read 4.1.6 and found the bit that outlaws $NULL$.

Now, which implementations have better ``quality'' - those that are happy with
a null pointer and no elements (where the meaning is ``obvious''), or those
that object (and hence force your code to be more portable) .... :-)
--

Regards, Kers.      | "You're better off  not dreaming of  the things to come;
Caravan:            | Dreams  are always ending  far too soon."



More information about the Comp.std.c mailing list