[Bug preprocessor/84161] New: preprocessor should discard Fortran comments

janus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Feb 1 08:19:00 GMT 2018


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

            Bug ID: 84161
           Summary: preprocessor should discard Fortran comments
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: janus at gcc dot gnu.org
  Target Milestone: ---

Consider this Fortran test case:


#define _ASSERT_(a, b)              if (.not. (a)) print *, b
program preproc_test
! _ASSERT_() is a nice macro :)
end


Putting this into an .F90 file and compiling with gfortran results in this
error:

 ! _ASSERT_() is a nice macro :)

Error: macro "_ASSERT_" requires 2 arguments, but only 1 given



The GCC preprocessor apparently ignores comments by default (at least with
C/C++, as documented in
https://gcc.gnu.org/onlinedocs/gfortran/Preprocessing-Options.html), so this
should also work with Fortran.


More information about the Gcc-bugs mailing list