-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Bruno Haible on 5/12/2009 6:49 PM: > Jakub Jelinek, when closing the two reported glibc bugs, agreed with > our interpretation that a NULL pointer is an invalid argument to memchr > but a pointer to a zero-sized memory region is valid. > > Here is a proposed patch to make the gnulib unit tests compliant, > without removing the particular test. > > Opinions? Objections?
I like it. It also means that we can use gcc's attribute((nonnull)) on the rpc_mem functions in our <string.h> replacement, to match some of the Linux distros that already made these tests hairy in the first place: > - void *nil = NULL; /* Use to avoid gcc attribute((nonnull)) warnings. */ > - > /* Test equal / not equal distinction. */ > - ASSERT (memcmp (nil, nil, 0) == 0); > + ASSERT (memcmp (zerosize_ptr (), zerosize_ptr (), 0) == 0); - -- Don't work too hard, make some time for fun as well! Eric Blake e...@byu.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkoKHCIACgkQ84KuGfSFAYDGGACfWyrM8sXqojZ3g+rFX9Umu6+Q WkIAn2qJnf6Ks+fSQRvnd5GkkOa1Ngh3 =IiHN -----END PGP SIGNATURE-----