Bug 492657 - gfortran compiler error with function RESULT keyword
Summary: gfortran compiler error with function RESULT keyword
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 10
Hardware: x86_64
OS: Linux
low
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-03-27 21:21 UTC by Wim Van Hoydonck
Modified: 2009-03-31 07:17 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2009-03-31 07:17:21 UTC
Type: ---
Embargoed:


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

Description Wim Van Hoydonck 2009-03-27 21:21:41 UTC
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:
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/037fa9f3c24ddfa6


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-1.5.0.0/jre --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 21:23:35 UTC
Created attachment 337065 [details]
source file that triggers compiler error

Comment 2 Jakub Jelinek 2009-03-31 07:17:21 UTC
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.