Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29253 Discussions

possible bug with !DIR$ directive and option /stand:f08

johnyb_
New Contributor I
627 Views

Take the following code:

subroutine test
	!DIR$ ATTRIBUTES DLLEXPORT :: test

    print *,"if this line exceeds 132 characters, the directive makes the compilation fail if using /stand:f08                                 1"
end subroutine

if I compile it with

ifort sub.f90 /c

I get no warnings or errors.

If however I compile it with 

ifort sub.f90 /c /stand:f08

I get:

C:\TEMP\x>ifort sub.f90 /c /stand:f08
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 16.0.0.110 Build 20150815
Copyright (C) 1985-2015 Intel Corporation.  All rights reserved.

sub.f90(2): warning #7025: This directive is not standard F2008.
    !DIR$ ATTRIBUTES DLLEXPORT :: test
----------^
sub.f90(4): warning #5268: Extension to standard: The text exceeds right hand column allowed on the line.
    print *,"if this line exceeds 132 characters, the directive makes the compilation fail                                         1"
------------------------------------------------------------------------------------------------------------------------------------^
sub.f90(4): error #5120: Unterminated character constant
    print *,"if this line exceeds 132 characters, the directive makes the compilation fail                                         1"
------------^
compilation aborted for sub.f90 (code 1)

C:\TEMP\x>

If I remove the !DIR$ directive I get a warning about the line length, but no error

Johny

0 Kudos
3 Replies
Kevin_D_Intel
Employee
627 Views

It does look like a bug. I reported this to Development.

(Internal tracking id: DPD200378724)

0 Kudos
johnyb_
New Contributor I
627 Views

I found this morning that the bug seems only to appear when using !DIR$, not with !DEC$.

According to the documentation !DEC$ is equivalent to !DIR$ so I will use this as a workaround

0 Kudos
Kevin_D_Intel
Employee
627 Views

Thank you for the added detail. I added that to the internal report. I'm glad you found the work around.

0 Kudos
Reply