(j3.2006) A few constants from ISO_Fortran_env for C interop

Van Snyder Van.Snyder
Mon Oct 24 22:17:59 EDT 2011


On Mon, 2011-10-24 at 18:53 -0700, Malcolm Cohen wrote:
> 
> Not generally true.  (If you are in a context that requires a constant
> [e.g. initialising a global] well then yes you need a constant, but if
> initialising a local variable of a procedure that is not true - in C,
> "type VAR = VAL;" has the same semantics as Fortran "type VAR; VAR =
> VAL".)

Not knowing this is what led to my recent discussion.

I assume this also works inside of the {...} list to initialize an array
or struct.

So having the unit number values provided by bind(C) module variables
that get their values from the Fortran constants in ISO_Fortran_env will
work just fine.

When I ask questions about C, your first assumption should be that you
have underestimated the depth of my ignorance of C.





More information about the J3 mailing list