autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why AC_C_CHAR_UNSIGNED?


From: Eric Blake
Subject: Re: Why AC_C_CHAR_UNSIGNED?
Date: Sun, 03 Aug 2008 17:19:32 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080708 Thunderbird/2.0.0.16 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Bob Friesenhahn on 8/3/2008 5:05 PM:
| On Sun, 3 Aug 2008, Eric Blake wrote:
|>
|> Was there any consensus as to whether obsoleting this macro was
|> worthwhile?  Remember, making the macro obsolete does not change its
|
| Since signed chars have not gone away, I don't think that obsoleting
| this macro is worthwhile.  There is often an alternative means to find
| out the same information but since the macro already exists this seems
| to be a change for the sake of change rather than an improvement.

But I argue that it IS an improvement.  We should not be encouraging the
use of implementation-reserved namespace (__CHAR_UNSIGNED__), when an
equally portable alternative exists in the user namespace (CHAR_MIN==0).
In general, any time I see code claiming to be portable but using leading
__, I have to question what is going on.  True, sometimes it is necessary,
but this seems to be one case where there is no good reason for new code
to pick up bad habits.  Old code that uses the macro does not need to
change until/unless someone decides to upgrade to newer autoconf _and_
silence the -Wall warning; obsoleting a macro does not make it unusable
(case in point: gnulib still has _loads_ of AC_TRY_COMPILE uses, even
though it is obsolete and should generally be replaced by AC_COMPILE_IFELSE).

If we do go ahead and make the macro obsolete, do you have a preferred
wording that would make it obvious what to do to silence the warning?
This is more verbose than Stepan's original proposal, but makes the point:

The macro AC_C_CHAR_UNSIGNED is obsolete.  To silence this warning,
replace instances such as
~ #ifdef __CHAR_UNSIGNED__
with
~ #include <limits.h>
~ #if CHAR_MIN == 0
then remove the use of this macro.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----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

iEYEARECAAYFAkiWPQQACgkQ84KuGfSFAYBrqQCggSuQxzgrGbcXcctxp2RzTrWq
CFAAoJW+OS2Oln8jJexB0x/WDm06stH4
=Rbwh
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]