- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When using C_LOC from ISO_C_BINDING, the standard states that items passed to C_LOC() must have the TARGET attribute. However, when I pass in a simple BYTE variable from a COMMON structure, the compiler does not produce any warnings or errors as would be expected.
BYTE START_ADR, END_ADR
STRUCTURE /TEST/
COMPLEX*8 SOME_VAL1
REAL*4 SOME_VAL2
END STRUCTURE
RECORD /TEST/ FOO
COMMON/CTEST/
& START_ADR(8),
& FOO(10000),
& END_ADR(4)
If I create a line with C_LOC( START_ADR ), ifort treats it as valid, but gfortran reports it as a violation of the standard. Intel's documentation on C_LOC seems to suggest it should be illegal as well unless I provide "TARGET START_ADR, END_ADR" somewhere after the variable definition.
Additionally (unrelated topic), in my implementation, I also define VOLATILE CTEST, but the standard suggests VOLATILE can only be defined on variables, not common definitions.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The above was the topic link. A support ticket was raised. I am not sure about the VOLATILE which is a different topic as you note. Given your code has non-standard constructs I would think you are not using standards checking. Intel could thus accept non-standard usage as an language extension. You would need to make an otherwise conforming test case I think.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page