Bug 492657 - gfortran compiler error with function RESULT keyword
gfortran compiler error with function RESULT keyword
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
x86_64 Linux
low Severity high
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2009-03-27 17:21 EDT by Wim Van Hoydonck
Modified: 2009-03-31 03:17 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-03-31 03:17:21 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
first (working) source file (201 bytes, text/plain)
2009-03-27 17:21 EDT, Wim Van Hoydonck
no flags Details
source file that triggers compiler error (213 bytes, text/plain)
2009-03-27 17:23 EDT, Wim Van Hoydonck
no flags Details

  None (edit)
Description Wim Van Hoydonck 2009-03-27 17:21:41 EDT
Created attachment 337064 [details]
first (working) source file

Description of problem:

gfortran issues an error when compiling functions returning a char that have the RESULT keyword, as in:

function charfun6 (input) result(output) bind(c,name="charfun6")

whereas the following syntax, that means exactly the same:

function return_char(i) bind(C,name='return_char')

does compile correctly.

This bug was discoverd in the following thread in comp.lang.fortran:

Version-Release number of selected component (if applicable):

$ gfortran -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.5.0-gcj- --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-cpu=generic --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC)

How reproducible:

Compile the attached files charfun6.f90 and charfun7.f90, both are equivalent, so should work.

Steps to Reproduce:
1. $ gfortran -c charfun6.f90
2. $ gfortran -c charfun7.f90

Actual results:
gfortran issues the following warning:
$ gfortran -c charfun7.f90
charfun7.f90: In function ‘return_char’:
charfun7.f90:7: error: aggregate value used where an integer was expected

Expected results:
no error

Additional info:
Comment 1 Wim Van Hoydonck 2009-03-27 17:23:35 EDT
Created attachment 337065 [details]
source file that triggers compiler error
Comment 2 Jakub Jelinek 2009-03-31 03:17:21 EDT
Should be fixed in gcc-4.4.0-0.31 in rawhide.

Note You need to log in before you can comment on or make changes to this bug.