[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
`#error' vs string literal (was: proposed gnulib-related additions to Au
`#error' vs string literal (was: proposed gnulib-related additions to Autoconf)
Tue, 7 Mar 2006 12:20:27 +0100
Another thing struck me:
* Paul Eggert wrote on Wed, Mar 01, 2006 at 01:48:54AM CET:
> (AC_HEADER_STDBOOL): Don't assume "#error" works.
> Index: lib/autoconf/headers.m4
> RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/headers.m4,v
> retrieving revision 1.45
> diff -p -u -r1.45 headers.m4
> --- lib/autoconf/headers.m4 24 Jan 2006 00:20:15 -0000 1.45
> +++ lib/autoconf/headers.m4 1 Mar 2006 00:45:24 -0000
> @@ -529,22 +562,22 @@ AC_DEFUN([AC_HEADER_STDBOOL],
> #include <stdbool.h>
> #ifndef bool
> -# error bool is not defined
> + "error: bool is not defined"
This technique is not followed consistently in gnulib (unlike Autoconf).
I remember that `#error' does not provoke failure everywhere, but don't
remember the offending compiler/system.
But there is even a patch to the contrary in gnulib, from coreutils:
| 2005-08-27 Jim Meyering <address@hidden>
| * md5.c: Use `#error' rather than a string literal to provoke failure.
| * sha1.c: Likewise.
I could not find corresponding discussion or bug reports. What's the
gist of this?
It'd be helpful to document the recommended way in autoconf.texi.
- `#error' vs string literal (was: proposed gnulib-related additions to Autoconf),
Ralf Wildenhues <=