- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
type, bind(c) :: fred
integer(2) :: JJ
integer(4) :: KK
end type
type :: bill
sequence
integer(2) :: JJ
integer(4) :: KK
end type
type(fred) :: afred
type(bill) :: abill
So with Intel(R) Visual Fortran Compiler 19.1.1.216 and no fancy compiler options
afred is 8 bytes ( 2 bytes padding )
abill is 6 bytes ( no padding but an alignment warning )
Does BIND(C) imply padding if the companion C compiler would do that by default? Is there any standard way of dealing with this issue?
For a specific windows API call I need the unpadded version. I would also like to know the size of abill. C_SIZEOF(abill) is not an option because we get the abill is non-interoperable error on the latest compiler. Yes I can use sizeof(abill) which is non-standard what standard option is available?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, an interoperable type pads if the "companion C processor" would do so. There is no standard syntax to eliminate such padding.
I'm curious - which API structure is involved?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Bitmaps (BMP) files that have a structure that goes back to 16 bit OS..... The problem is not a problem just an irritation.....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well a guess sequence is standard so that and storage_size will do what I want.....
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page