From: Paul Eggert Date: Thu, 6 Apr 2006 07:58:20 +0000 (+0000) Subject: * doc/autoconf.texi (C Compiler): Warn about #error. Follows up X-Git-Tag: AUTOCONF-2.59c~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=119f63f5458669c7bca998a02752e7da40c5e4df;p=thirdparty%2Fautoconf.git * doc/autoconf.texi (C Compiler): Warn about #error. Follows up on a patch proposed by Ralf Wildenhues. --- diff --git a/ChangeLog b/ChangeLog index 0930e1654..c751559a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-04-06 Paul Eggert + + * doc/autoconf.texi (C Compiler): Warn about #error. Follows up + on a patch proposed by Ralf Wildenhues. + 2006-04-05 Paul Eggert * lib/autoconf/status.m4: Replace '' with diff --git a/doc/autoconf.texi b/doc/autoconf.texi index bbf3e486d..220f0527c 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -5795,6 +5795,15 @@ This can cause problems if you observe the output of the compiler to detect failures. Invoking @samp{cc -c a.c && cc -c b.c && cc -o c a.o b.o} solves the issue. +@item Don't rely on @code{#error} failing +The @sc{irix} C compiler does not fail when #error is preprocessed; it +simply emits a diagnostic and continues, exiting successfully. So, +instead of an error directive like @code{#error "Unsupported word size"} +it is more portable to use an invalid directive like @code{#Unsupported +word size} in Autoconf tests. In ordinary source code, @code{#error} is +OK, since installers with inadequate compilers like @sc{irix} can simply +examine these compilers' diagnostic output. + @item Don't rely on correct @code{#line} support On Solaris 8, @command{c89} (Sun WorkShop 6 update 2 C 5.3 Patch 111679-08 2002/05/09)) diagnoses @code{#line} directives whose line