This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug preprocessor/67551] New: Preprocessor generates non-ISO line directives


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67551

            Bug ID: 67551
           Summary: Preprocessor generates non-ISO line directives
           Product: gcc
           Version: 5.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: porten at kde dot org
  Target Milestone: ---

The code emitted by the preprocessor does produce warnings when compiled as
C/C++ code with -pedantic:

$ echo "int main() { return 0; }" > input.c
$ cpp -o output.c input.c
$ gcc -pedantic output.c

output.c:1:3: warning: style of line directive is a GCC extension
 # 1 "input.c"
   ^
input.c:1:3: warning: style of line directive is a GCC extension
 int main() { return 0; }
   ^
<built-in>: warning: style of line directive is a GCC extension
<command-line>:1:3: warning: style of line directive is a GCC extension
<command-line>:1:3: warning: style of line directive is a GCC extension

Admittedly, this is not the normal usage mode. And when using an .i suffix for
the output file (as done by -save-temps) the -pedantic check does not kick in.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]