This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Bug fortran/32732] [Bind C] Character scalars are passed as arrays
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: burnus at net-b dot de
- Cc: fortran at gcc dot gnu dot org, crickett at lanl dot gov
- Date: Thu, 26 Jul 2007 09:22:28 -0700 (PDT)
- Subject: Re: [Bug fortran/32732] [Bind C] Character scalars are passed as arrays
> Well, I think you have to do more debugging then. First, could you run
> the two attached programs and compare the "sizeof" sizes; they should
> always match, if they don't you you have found one problem.
OK, I tried this in 32 and 64 bit modes. (In 32 bit mode I had to
change the type of size (in printf) to make the Fortran program
compile.) The only difference I see is with complex types. In 32 or 64
bit mode I get:
C:
sizeof(float) = 4
sizeof(double) = 8
sizeof(long double) = 16
sizeof(complex float) = 8
sizeof(complex double) = 16
sizeof(complex long double) = 32
FTN:
float: sizeof = 4, kind = 4
double: sizeof = 8, kind = 8
long double: sizeof = 16, kind = 16
complex float: sizeof = 8, kind = 4
complex double: sizeof = 8, kind = 8
complex long double: sizeof = 8, kind = 16
Everthing else looked OK, I don't think this is the char problem that we
are seeing but may be another problem. I see the same problem (if it is
a problem) on x86_64, so this is not an IA64 or HP-UX specific issue.
I will look more into the char issue and see if I can get some more
data on what is happening.
Steve Ellcey
sje@cup.hp.com