[Bug libfortran/52431] New: Pass Fortran logical to C function
only_for_nouse at gmx dot de
gcc-bugzilla@gcc.gnu.org
Wed Feb 29 10:06:00 GMT 2012
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)
More information about the Gcc-bugs
mailing list