This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Indented #line directives
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: Indented #line directives
- From: Michael Meissner <meissner at cygnus dot com>
- Date: Fri, 19 May 2000 14:20:59 -0400
- Cc: gcc-bugs at gcc dot gnu dot org, Zack Weinberg <weinberg at cygnus dot com>
- References: <20000519110901K.mitchell@codesourcery.com>
On Fri, May 19, 2000 at 11:09:01AM -0700, Mark Mitchell wrote:
>
> Zack --
>
> The preprocessor is emitting `#' directives in non-zero columns.
> For example, this came out of a preprocessed source file:
>
> # 1 "/home/mitchell/dev/egcs-2/new-abi-objdir/gcc/include/limits.h" 1 3
>
> Note that the `#' is not in the leftmost column.
Note for handling .S files where the preprocessor is run before the assembler,
there are gas ports that do not use '#' for a comment character, but they
explicitly allow '#' in column 1 just to handle preprocessor line numbers.
> Perhaps this is because that file contains:
>
> #ifdef _GCC_NEXT_LIMITS_H
> #include_next <limits.h> /* recurse down to the real one */
> #endif
>
> That's bogus, and I'll fix it. Isn't the preprocessor supposed to
> reject `#' directives that don't occur in the leftmost column?
ISO C explicitly requires support of whitespace before the '#'. Tradiational
preprocessors only looked for the '#' in column 1. This meant you could do:
#ifdef SHOULD_NOT_HAPPEN
#error "I'm sorry Dave, I can't do that"
#endif
and it would not cause the traditional compiler to complain.
--
Michael Meissner, Cygnus Solutions, a Red Hat company.
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work: meissner@redhat.com phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org fax: +1 978-692-4482