This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Error preprocessing a fortran comment


I have the following test case which fails to build as follow:

$ cat prep_test.f90
!
!   rm -rf {*.mod,~/programming/modules/*} && \
!   gfortran[-mp-X] [-Warray-temporaries] -O3 -Wall \
!     -Wno-unused-dummy-argument $BLD_OPTS -J ~/programming/modules \
!     ~/programming/basic-modules/{kind,math}_consts.f90 \
!     ~/programming/ode-modules/{everhart_integrator,\
!       cernlib_integrators}.f90 test_jsunp.f90 -o test_jsunp$EXE && \
!     rm -rf {*.mod,~/programming/modules/*}
!
!   ./test_jsunp$EXE

!
! gfortran -cpp prep_test.f90 -o prep_test.out
!
program prep_test
  implicit none
#if defined(PRINT_MSG)
  print *, 'Hello World'
#endif
  print *, 'NO MSG'
end program prep_test

$ gfortran -cpp -DPRINT_MSG prep_test.f90 -o prep_test.out
prep_test.f90:2:0: error: unterminated comment
 !   rm -rf {*.mod,~/programming/modules/*} && \
 ^

To have it builds, I have to remove the comment lines containing

  rm -rf {*.mod,~/programming/modules/*}


I wonder if this is to be expected... or if one can exclude comment from preprocessing.


Thanks,
  Angelo.


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