[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `#error' vs string literal
From: |
Paul Eggert |
Subject: |
Re: `#error' vs string literal |
Date: |
Thu, 06 Apr 2006 01:27:59 -0700 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) |
Ralf Wildenhues <address@hidden> writes:
> Ping. It'd be nice to know if this has a chance of being acceptable,
> or if I should just drop it.
I installed this instead, as I think it's a bit clearer.
2006-04-06 Paul Eggert <address@hidden>
* doc/autoconf.texi (C Compiler): Warn about #error. Follows up
on a patch proposed by Ralf Wildenhues.
--- doc/autoconf.texi 5 Apr 2006 22:41:36 -0000 1.984
+++ doc/autoconf.texi 6 Apr 2006 07:58:20 -0000 1.985
@@ -5795,6 +5795,15 @@ This can cause problems if you observe t
detect failures. Invoking @samp{cc -c a.c && cc -c b.c && cc -o c a.o
b.o} solves the issue.
address@hidden 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