Minor problem with #error directive
Jim Wilson
wilson@chestnut.cygnus.com
Fri Sep 5 20:39:00 GMT 1997
This program:
#error This shouldn't cause a problem
Causes this output:
error.cpp:1: unterminated string or character constant
Gcc is correct. The ANSI C standard says that the text after the #error
directive must be a list of preprocessing tokens. This is not the case
above, because you have an unterminated character constant, hence it
requires a diagnostic for the syntax error.
Jim
More information about the Gcc-bugs
mailing list