[Flang-dev] Should this code compile?

Nathan Sircombe Nathan.Sircombe at arm.com
Tue Sep 18 10:09:05 EDT 2018


Hi,

Works for me (in that __GNUC__ isn’t set and it baulks at the attempt to compile ‘choke me’, swap to #ifdef and it compiles the empty (once the pre-processor is done with it) program ok).

Shouldn’t need to set free-form for ‘F90’ – but it works with or without.
I can’t see what’s wrong with yours…

Nathan.

Nathan John Sircombe HPC | Arm
. . . . . . . . . . . . . . . . . . . . . . . . . . .
p: +44 161 509 1904
arm.com<http://www.arm.com>

On 18/09/2018, 14:57, "flang-dev on behalf of blubee blubeeme" <flang-dev-bounces at lists.flang-compiler.org<mailto:flang-dev-bounces at lists.flang-compiler.org> on behalf of gurenchan at gmail.com<mailto:gurenchan at gmail.com>> wrote:


On Tue, Sep 18, 2018 at 12:57 AM blubee blubeeme <gurenchan at gmail.com<mailto:gurenchan at gmail.com>> wrote:
        program main
#ifndef __GNUC__
        choke me
#endif
        end

I am trying to compile this code with numerous extensions, F, f, f90, F90

They all return error codes.

I am using the -ffree-form flag with flang
I either get these results:

flang -ffree-form choke.F90
F90-W-0915-Illegal macro name (choke.F90: -1)
F90-W-0915-Illegal macro name (choke.F90: -1)
F90-F-0952-Unexpected EOF following # directive (choke.F90: -1)
F90/amd64-FreeBSD FreeBSD Flang - 1.5 2017-05-01: compilation aborted


flang -ffree-form choke.F
F90-W-0915-Illegal macro name (choke.F: -1)
F90-W-0915-Illegal macro name (choke.F: -1)
F90-F-0952-Unexpected EOF following # directive (choke.F: -1)
F90/amd64-FreeBSD FreeBSD Flang - 1.5 2017-05-01: compilation aborted


flang -ffree-form choke.f
F90-S-0021-Label field of continuation line is not blank (choke.f: 2)
F90-S-0021-Label field of continuation line is not blank (choke.f: 4)
  0 inform,   0 warnings,   2 severes, 0 fatal for main


flang -ffree-form choke.f90
F90-S-0021-Label field of continuation line is not blank (choke.f90: 2)
F90-S-0021-Label field of continuation line is not blank (choke.f90: 4)
  0 inform,   0 warnings,   2 severes, 0 fatal for main


Is it possible to compile this code? If not are there any edits that I can make to allow it to successfully compile?

Best,
Owen
Can I bump this issue?

I've tried changing the file extension from f, F, f90, F90 and I've tried with -cpp, -c, -Mpreprocess and a few others.

The program just fails to compile.

Am I missing some compiler flags or is this just a bug in Flang?

Best,
Owen
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.flang-compiler.org/pipermail/flang-dev_lists.flang-compiler.org/attachments/20180918/73cc54c9/attachment-0001.html>


More information about the flang-dev mailing list