bug-gnulib
[Top][All Lists]
Advanced

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

Re: AC_HEADER_STDBOOL rejects valid C99 implementation


From: Paul Eggert
Subject: Re: AC_HEADER_STDBOOL rejects valid C99 implementation
Date: Sun, 14 May 2006 20:33:52 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Fedor Sergeev of Sun pointed out that my analysis of (bool) -0.5 as an
integer constant expression was incorrect, as the "-" isn't allowed in
C99.  I installed this fix into gnulib and coreutils (and a similar
fix into autoconf).

2006-05-14  Paul Eggert  <address@hidden>

        * stdbool.m4 (AC_HEADER_STDBOOL): Fix overly-picky
        test for C99 conformance; (bool) 0.5 is an integer constant
        expression, but (bool) -0.5 is not.  Problem reported by Fedor
        Sergeev in <http://forum.sun.com/jive/thread.jspa?threadID=96202>.

--- m4/stdbool.m4       26 Jan 2006 13:32:38 -0000      1.10
+++ m4/stdbool.m4       15 May 2006 02:37:03 -0000      1.11
@@ -64,9 +64,9 @@ AC_DEFUN([AC_HEADER_STDBOOL],
          char a[true == 1 ? 1 : -1];
          char b[false == 0 ? 1 : -1];
          char c[__bool_true_false_are_defined == 1 ? 1 : -1];
-         char d[(bool) -0.5 == true ? 1 : -1];
+         char d[(bool) 0.5 == true ? 1 : -1];
          bool e = &s;
-         char f[(_Bool) -0.0 == false ? 1 : -1];
+         char f[(_Bool) 0.0 == false ? 1 : -1];
          char g[true];
          char h[sizeof (_Bool)];
          char i[sizeof s.t];




reply via email to

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