public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/52431] New: Pass Fortran logical to C function
@ 2012-02-29 10:06 only_for_nouse at gmx dot de
2012-02-29 10:09 ` [Bug libfortran/52431] " pinskia at gcc dot gnu.org
2012-02-29 10:11 ` pinskia at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: only_for_nouse at gmx dot de @ 2012-02-29 10:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52431
Bug #: 52431
Summary: Pass Fortran logical to C function
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libfortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: only_for_nouse@gmx.de
Created attachment 26780
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26780
Tar file containing a Fortran program, the C function and a small Makefile.
If passing a Fortran LOGICAL(C_BOOL) as argument to an interoperable C routine,
I always get this variable to be true in the C routine, independent of the
value passed.
Untar the attached file (it contains the Fortran and the C source files and a
Makefile) and run the Makefile. Running the resulting program with
./pass_logical
gives an output of
The value of the boolean argument passed is true.
The value of the boolean argument passed is true.
The second call should give a value of false.
gfortran -v gives:
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/somepath/gcc/4.6.2/@sys/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/somepath/gcc/4.6.2/amd64_sles11
--with-mpc=/somepath/gcc/4.6.1/amd64_sles11/opt/deps
--with-mpfr=/somepath/gcc/4.6.1/amd64_sles11/opt/deps
--with-gmp=/somepath/gcc/4.6.1/amd64_sles11/opt/deps
--with-ppl=/somepath/gcc/4.6.1/amd64_sles11/opt/deps
--with-cloog=/somepath/gcc/4.6.1/amd64_sles11/opt/deps
Thread model: posix
gcc version 4.6.2 (GCC)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug libfortran/52431] Pass Fortran logical to C function
2012-02-29 10:06 [Bug libfortran/52431] New: Pass Fortran logical to C function only_for_nouse at gmx dot de
@ 2012-02-29 10:09 ` pinskia at gcc dot gnu.org
2012-02-29 10:11 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-02-29 10:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52431
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-02-29 10:06:14 UTC ---
I think you forgot the value attribute like:
logical(C_BOOL), value :: inbool
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug libfortran/52431] Pass Fortran logical to C function
2012-02-29 10:06 [Bug libfortran/52431] New: Pass Fortran logical to C function only_for_nouse at gmx dot de
2012-02-29 10:09 ` [Bug libfortran/52431] " pinskia at gcc dot gnu.org
@ 2012-02-29 10:11 ` pinskia at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-02-29 10:11 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52431
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-02-29 10:10:09 UTC ---
Your code is wrong. You need either the value attribute on the Fortran side or
change the C side to take a pointer.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-02-29 10:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-29 10:06 [Bug libfortran/52431] New: Pass Fortran logical to C function only_for_nouse at gmx dot de
2012-02-29 10:09 ` [Bug libfortran/52431] " pinskia at gcc dot gnu.org
2012-02-29 10:11 ` pinskia at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).