Record size from a lib differs from one executable to another
Hi,
I'm facing a problem that leaves me extremely perplexed (I can hardly believe what I'm seeing). I have a library that defines a record. This record will be used to instantiate a shared memory between different executables.
The first executable calls a function in this library which will create the shared memory. The other executables will communicate through it. Except that it doesn't work. After hours of debugging, I noticed that the size of my structure (aspect 'Size) is different between the first executable and the others: it's 4 times smaller!
Everything was recompiled and tested multiple times to make sure this was the case. In every executables, 'Size and 'Object_Size are the same. Printing the size of the record in the package initialization returns the correct value, the one used by every executables except the first one.
I think this will leave you really perplex too. Have you ever encounter a similar issue?
I believe there is a way to ask the gnat compiler (or gprbuild) for a file that gives the size given for each types, right? Which flag is it?
Thanks for your help.
[link] [comments]