[llvm-bugs] [Bug 47466] New: comments to the right of an include not allowed

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 8 14:50:00 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47466

            Bug ID: 47466
           Summary: comments to the right of an include not allowed
           Product: flang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedbugs at nondot.org
          Reporter: naromero at anl.gov
                CC: David.Truby at arm.com, jperier at nvidia.com,
                    kirankumartp at gmail.com, llvm-bugs at lists.llvm.org,
                    sscalpone at nvidia.com

Created attachment 23939
  --> https://bugs.llvm.org/attachment.cgi?id=23939&action=edit
Test include header file with comment

A comment to the right of include line is not supported by the Flang front-end. 
  #include "simpleheader.fh"      ! Simple header

[naromero at naromero-desktop bugs]$
/nfs/gce/projects/naromero-workspace/llvm-master/bin/flang -c
testheadercomments.F 
/nfs/gce/projects/naromero-workspace/llvm-master/bin/f18: could not scan
testheadercomments.F
testheadercomments.F:2:10: error: #include: expected name of file to include
  #include "simpleheader.fh"      ! Simple header
           ^^^^^^^^^^^^^^^^^

I am not sure if this is part of the Fortran language standard or not, but
ifort supports it without warnings. PGI and Gfortran support it, but issue a
warning.


[naromero at naromero-desktop bugs]$ pgfortran -c testheadercomments.F 
PGF90-W-0951-Extraneous tokens ignored following # directive
(testheadercomments.F: 2)

GFortran
[naromero at naromero-desktop bugs]$ gfortran -c testheadercomments.F 
testheadercomments.F:2:0:

 #include "simpleheader.fh"      ! Simple header

Warning: extra tokens at end of #include directive

I am not sure if this is part of the Fortran standard or not.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200908/2de0e6bc/attachment-0001.html>


More information about the llvm-bugs mailing list