This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]