Akim Demaille writes:

> I think Autoconf should advocate a single approach.  

Yup.

> Also, is `HAVE_WORKING_FOO' the right naming scheme?  Is it powerful
> enough to allow us the specify the various brokenness that this or
> that function may have?  Should HAVE_WORKING_FOO always be the `or' of
> HAVE_FOO_BLAHBLAH_BUG, HAVE_FOO_SOMEOTHER_BUG etc.?

"Working" is a fairly volatile term. free() "works" if it frees memory. If
it doesn't grok null pointers, that's an unfortunate circumstance but not
necessarily "not working" by all standards.

What's the point? Who's going to write

#if HAVE_FREE_NULL_BUG
if (mem != NULL)
  free(mem)
#else
free(mem);
#endif

everywhere? Some people that think they're smarter than optimizing
compilers might try to pull stunts like that, but really...

On the other hand there are things like snprintf, most implementations of
which are not "working", but it's easy to provide your own snprintf.o that
works (unlike free and realloc, which are a little harder to replace). In
that case you should just test whether everything works or else use your
good version.

Also, these sort of tests will inevitably have problems with
cross-compilers.


-- 
Peter Eisentraut                  Sernanders väg 10:115
[EMAIL PROTECTED]                   75262 Uppsala
http://yi.org/peter-e/            Sweden


Reply via email to