From: Jim Meyering <[EMAIL PROTECTED]>
Date: 14 Mar 2000 09:16:08 +0100
I didn't test it, but rather based it on a fileutils ChangeLog entry
from you. Maybe you were using a different version of cc back when
you wrote it?
No, it's the same cc. Russ Allbery had the right analysis.
Rereading that ChangeLog, I think I gave up on ` #error "foo"' on the
theory that there might be some C compiler that might mishandle it,
and submitted a patch with a forced syntax error since I was more sure
that this would work everywhere.
Unfortunately, the forced-syntax-error approach produces diagnostics
that are harder to read (assuming modern compilers). So in retrospect
I was probably too hasty in giving up on ` #error "foo"'. As Thomas
E. Dickey notes, with a pre-ANSI compiller` #error "foo"' gives just
as bad a diagnostic as a forced syntax error does, but it's no longer
important to make diagnostics beautiful with those old compilers: as
long as the compiler rejects the program, that's good enough.
There are other portable approaches to forcing an error based on
preprocessor computations (e.g. one can declare an array with a
negative size), but ` #error "foo"' is the cleanest one I know.