[Bug modula2/114648] compiler by default does not handle C pre-processor file and line directives

2024-04-08 Thread gaius at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114648

Gaius Mulley  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Gaius Mulley  ---
Closing now the patch has been applied.

[Bug modula2/114648] compiler by default does not handle C pre-processor file and line directives

2024-04-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114648

--- Comment #5 from GCC Commits  ---
The master branch has been updated by Gaius Mulley :

https://gcc.gnu.org/g:600bf396799a022e65938de572ad1a79a951b95a

commit r14-9849-g600bf396799a022e65938de572ad1a79a951b95a
Author: Gaius Mulley 
Date:   Tue Apr 9 02:35:11 2024 +0100

PR modula2/114648 cc1gm2 by default does not handle C pre-processor file
and line directives

This patch fixes the default behavior of cc1gm2 to the description in
the documentation.  By default cc1gm2 will allow C preprocessor
directives (they can be turned off via -fno-cpp).

gcc/m2/ChangeLog:

PR modula2/114648
* gm2-compiler/M2Options.mod (LineDirectives): Initially
set to true.

gcc/testsuite/ChangeLog:

PR modula2/114648
* gm2/cpp/default/pass/AdvParse.def: New test.
* gm2/cpp/default/pass/AdvParse.mod: New test.
* gm2/cpp/default/pass/cpp-default-pass.exp: New test.

Signed-off-by: Gaius Mulley 

[Bug modula2/114648] compiler by default does not handle C pre-processor file and line directives

2024-04-08 Thread gaius at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114648

--- Comment #4 from Gaius Mulley  ---
Created attachment 57907
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57907=edit
Proposed fix

Trivial patch fix proposed with test code.

[Bug modula2/114648] compiler by default does not handle C pre-processor file and line directives

2024-04-08 Thread gaius at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114648

--- Comment #3 from Gaius Mulley  ---
it will handle both, implemented in:  gcc/m2/m2.flex:171
but the default was inverted during a recent bugfix.
The particular test code example which provoked the bug was:

# 2 "AdvParse.bnf"
IMPLEMENTATION MODULE AdvParse ;

[Bug modula2/114648] compiler by default does not handle C pre-processor file and line directives

2024-04-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114648

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||rejects-valid

--- Comment #2 from Andrew Pinski  ---
Which ones are we talking about, the GNU extension `# LINE "FILE" ...` or the
`#line LINE "FILE"` version? Or both?

[Bug modula2/114648] compiler by default does not handle C pre-processor file and line directives

2024-04-08 Thread gaius at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114648

Gaius Mulley  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2024-04-09
 Status|UNCONFIRMED |ASSIGNED

--- Comment #1 from Gaius Mulley  ---
Confirmed.