Re: Why AC_C_CHAR_UNSIGNED?

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

 



Hello,

On Mon, Jun 23, 2008 at 04:05:21PM -0500, Bob Friesenhahn wrote:
> My own software does not currently depend on limits.h but tests I did  
> separately on many types of systems (including several 12 year old ones) 
> with a program which specifically exercises limits.h (including 'char') 
> did not encounter any problems.

thank you for your information.  On that ground, I have prepared the
following patch.  Ok to commit?

Have a nice day,
	Stepan
>From 108a48c5682b090c1ef19e4b126608a60a1319e7 Mon Sep 17 00:00:00 2001
From: Stepan Kasal <skasal@xxxxxxxxxx>
Date: Tue, 24 Jun 2008 17:25:31 +0200
Subject: [PATCH] Make AC_C_CHAR_UNSIGNED obsolete.

* lib/autoconf/c.m4 (AC_C_CHAR_UNSIGNED): Warn that it is obsolete;
reported by Hallvard B Furuseth.
* doc/autoconf.texi (C Compiler): Move AC_C_CHAR_UNSIGNED...
(Obsolete Macros): ...here, and mention why.
* NEWS: Mention.
---
 ChangeLog         |    9 +++++++++
 NEWS              |   10 +++++++---
 doc/autoconf.texi |   22 +++++++++++++---------
 lib/autoconf/c.m4 |    7 ++++++-
 tests/mktests.sh  |    2 +-
 5 files changed, 36 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 065a75b..5d97d9f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-06-24  Stepan Kasal  <kasal@xxxxxx>
+
+	Make AC_C_CHAR_UNSIGNED obsolete.
+	* lib/autoconf/c.m4 (AC_C_CHAR_UNSIGNED): Warn that it is obsolete;
+	reported by Hallvard B Furuseth.
+	* doc/autoconf.texi (C Compiler): Move AC_C_CHAR_UNSIGNED...
+	(Obsolete Macros): ...here, and mention why.
+	* NEWS: Mention.
+
 2008-06-19  Eric Blake  <ebb9@xxxxxxx>
 
 	Add comment explaining recent patch.
diff --git a/NEWS b/NEWS
index 06b705f..895f66e 100644
--- a/NEWS
+++ b/NEWS
@@ -6,11 +6,15 @@ GNU Autoconf NEWS - User visible changes.
    library directories.
 
 ** Newly obsolete macros
-   The following macro has been marked obsolete, since current porting
-   targets can safely assume C89 semantics that signal handlers return
-   void.  We have no current plans to remove the macro.
+   The following macros have been marked obsolete since they are no longer
+   needed for the current set of porting targets.  We have no current plans
+   to remove them.
 
+     AC_C_CHAR_UNSIGNED
+	It is possible to #include <limits.h> and test for CHAR_MIN == 0.
+       
      AC_TYPE_SIGNAL
+	The C89 semantics that signal handlers return void can be assumed.
 
 ** Clients of m4_expand, such as AS_HELP_STRING and AT_SETUP, can now
    handle properly quoted but otherwise unbalanced parentheses (for
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 43a84bc..08d4168 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -6855,14 +6855,6 @@ Otherwise define @code{inline} to @code{__inline__} or @code{__inline}
 if it accepts one of those, otherwise define @code{inline} to be empty.
 @end defmac
 
-@anchor{AC_C_CHAR_UNSIGNED}
-@defmac AC_C_CHAR_UNSIGNED
-@acindex{C_CHAR_UNSIGNED}
-@cvindex __CHAR_UNSIGNED__
-If the C type @code{char} is unsigned, define @code{__CHAR_UNSIGNED__},
-unless the C compiler predefines it.
-@end defmac
-
 @defmac AC_C_STRINGIZE
 @acindex{C_STRINGIZE}
 @cvindex HAVE_STRINGIZE
@@ -18529,6 +18521,18 @@ Replaced by @code{AC_FUNC_ALLOCA} (@pxref{AC_FUNC_ALLOCA}).
 Removed because of limited usefulness.
 @end defmac
 
+@defmac AC_C_CHAR_UNSIGNED
+@acindex{C_CHAR_UNSIGNED}
+@cvindex __CHAR_UNSIGNED__
+If the C type @code{char} is unsigned, define @code{__CHAR_UNSIGNED__},
+unless the C compiler predefines it.
+
+@c Reported by Hallvard B Furuseth, verified by a reserch by Bob Friesenhahn,
+@c see http://lists.gnu.org/archive/html/autoconf/2008-06/msg00066.html
+The macro is no longer needed; it is now portable to include @file{limits.h}
+and check whether @code{CHAR_MIN} is 0.
+@end defmac
+
 @defmac AC_C_CROSS
 @acindex{C_CROSS}
 This macro is obsolete; it does nothing.
@@ -18559,7 +18563,7 @@ other macros (@pxref{Canonicalizing}).
 
 @defmac AC_CHAR_UNSIGNED
 @acindex{CHAR_UNSIGNED}
-Replaced by @code{AC_C_CHAR_UNSIGNED} (@pxref{AC_C_CHAR_UNSIGNED}).
+Same as @code{AC_C_CHAR_UNSIGNED} which is obsolete as well, see above.
 @end defmac
 
 @defmac AC_CHECK_TYPE (@var{type}, @var{default})
diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4
index ffaa06e..edd00e7 100644
--- a/lib/autoconf/c.m4
+++ b/lib/autoconf/c.m4
@@ -1377,8 +1377,13 @@ AU_DEFUN([AC_C_CROSS], [])
 
 # AC_C_CHAR_UNSIGNED
 # ------------------
+# This macro is now considered obsolete, see
+# http://lists.gnu.org/archive/html/autoconf/2008-06/msg00066.html
+# 
 AC_DEFUN([AC_C_CHAR_UNSIGNED],
-[AH_VERBATIM([__CHAR_UNSIGNED__],
+[AC_DIAGNOSE([obsolete], [The macro `$0' is obsolete.
+Check for CHAR_MIN == 0 from limits.h instead.])dnl
+AH_VERBATIM([__CHAR_UNSIGNED__],
 [/* Define to 1 if type `char' is unsigned and you are not using gcc.  */
 #ifndef __CHAR_UNSIGNED__
 # undef __CHAR_UNSIGNED__
diff --git a/tests/mktests.sh b/tests/mktests.sh
index 04c6d60..158584f 100755
--- a/tests/mktests.sh
+++ b/tests/mktests.sh
@@ -112,7 +112,7 @@ ac_exclude_list='
 	/^AC_FD_CC$/ {next}
 
 	# Obsolete, but needs to be AC_DEFUNed.
-	/^AC_FOREACH$/ {next}
+	/^AC_(FOREACH|C_CHAR_UNSIGNED)$/ {next}
 
 	# Require a file that is not shipped with Autoconf.  But it should.
 	/^AC_FUNC_(GETLOADAVG|FNMATCH_GNU)$/ {next}
-- 
1.5.5.3

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux