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

            Bug ID: 123273
           Summary: -E -fdirectives-only reporting error on comments
           Product: gcc
           Version: 15.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: yshuiv7 at gmail dot com
  Target Milestone: ---

Created attachment 63132
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63132&action=edit
mpeghead.h

discovered when build mpg123. See attachment for the mpeghead.h header.

Run:

gcc mpeghead.h -E -fdirectives-only -o /dev/null

Output:

mpeghead.h:27:118: error: unterminated literal
   27 |                 print "#define HDR_${name}_VAL(h)".(" " x
(11-length($name)))."(((h)\&HDR_$name) >> ".length($1).")\n";
      |                                                                        
                                             ^
mpeghead.h:8: error: unterminated #ifndef
    8 | #ifndef MPG123_MPEGHEAD_H

Line 27 is a comment.

Running without -fdirectives-only completes without errors.

Reply via email to