compiler construction - Definitive length of primitive C and Fortran types -


i revamping native bindings blas/lapack (fortran libraries) major os on 32/64 bit java library: netlib-java.

however, i've started hit problems data type differences between unix/windows world, , between fortran / c.

tables of fortran , c data types pretty non-commital because sizes are not explicitly defined c language.

is there canonical source (or can create 1 referencing authoritative sources?) of bit sizes in practice of primitive data types on major oses both fortran , c?

or, @ least, fortran types in terms of c types.

i.e. populate table following columns (with few begin):

os      arch    language type             bits linux   x86_64  c        int              32 linux   x86_64  c        long             64 linux   x86_64  c        float            32 linux   x86_64  c        double           64 linux   x86_64  fortran  logical          32 linux   x86_64  fortran  integer          32 linux   x86_64  fortran  real             32 linux   x86_64  fortran  double precision 64 linux   x86_64  java jni jint             32 windows x86_64  fortran  integer          32 windows x86_64  java jni jint             64 ... 

(i'm not sure if correct)

it possible lookup java types in terms of c primitives in jni_md.h shipped every jdk.

as noted @cup in comments, there iso_c_binding standard. gives level of comfort (at least gcc) mappings noted in cblas/lapacke c api (which uses basic c types) portable across architectures compiler. noted in question, bit sizes in practice, not abstract concept of languages guarantee. i.e.

  • real -> float
  • double precision -> double
  • integer -> int
  • logical -> int

and it's c define byte sizes of primitive types , jni_md.h define java primitive types.

in practice, means disconnect on 64 bit windows long 32 bit (64 bit on 64 bit linux) , jint defined in terms of long. therefore compiler complains jint*/int type conversions during windows builds can safely ignored.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -