This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Unknown preprocessor directives
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: Unknown preprocessor directives
- From: Zack Weinberg <weinberg at cygnus dot com>
- Date: Fri, 30 Jun 2000 17:31:15 -0700
- Cc: gcc-bugs at gcc dot gnu dot org
- References: <20000630150125C.mitchell@codesourcery.com>
On Fri, Jun 30, 2000 at 03:01:25PM -0700, Mark Mitchell wrote:
>
> I typed `#iF' in some code (instead of `#if'). I was confused when I
> saw this message:
>
> foo.c:9190: unbalanced `#endif'
>
> It would have been easier for me if this had said "Hey, numbskull,
> watch your typing; there's no such thing as `#iF'." Is it reasonable
> to have the preprocessor issue a warning in this case?
In the development tree, it already does:
$ cat x.c
#iF 1
#endif
$ ./cpp x.c /dev/null
x.c:1:1: invalid preprocessing directive #iF
x.c:2:6: #endif without #if
$
cccp didn't used to generate a diagnostic for bogus directives, and I
suspect you're using it since your error message has no column number.
However, in 2.95, cc1 *would* generate that diagnostic; were you using -E?
zw