Arm Community
Site
Search
User
Site
Search
User
Support forums
Arm Development Studio forum
armcc
Jump...
Cancel
Locked
Locked
Replies
2 replies
Subscribers
119 subscribers
Views
4152 views
Users
0 members are here
Options
Share
More actions
Cancel
Related
How was your experience today?
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion
armcc
Simha JKC
over 12 years ago
Note: This was originally posted on 5th April 2013 at
http://forums.arm.com
Is there a compiler option or pragma that allows me to see "padding" in c structure?
typedef struct st
{
char a;
int b;
} mytype; Basically, say I have above defined struct then I wish to known how compiler pads it.
list file does not seem to provide the needed details.
--diag_warning=1301
--diag_warning=2530
I tried above options, it shows warning when ever the compiler pads but the issue is i still do
not get how many bytes and where the padding is applied in the structure.
is there a easy way to get those two details ?
Parents
Simha JKC
over 12 years ago
Note: This was originally posted on 9th April 2013 at
http://forums.arm.com
thanks for sharing additional information.
@scott
: your suggested idea is not feasible as i am dealing with structures that are huge i.e., size is in 100s of KBs with many types of data types [size="2"]used in struct
[/size]
@archie:
i tried using "--remarks" it still does not help as it does not provide padding size and also the place where it is padding. below is the compile log
C:\c>armcc --remarks 1.c
"1.c", line 3: #1301-D: padding inserted in struct st
"1.c", line 3: #2530-D: padding added to end of struct st
"1.c", line 14: #181-D: argument is incompatible with corresponding format string conversion
printf ("sizeof (me) = %d \n",sizeof(me));
^
"1.c", line 16: Warning: #1-D: last line of file ends without a newline
}
^
1.c: 1 warning, 0 errors
C:\c>
recently i tried "fromelf" with option "--expandarrays" and even that is not helping me.
Cancel
Vote up
0
Vote down
Cancel
Reply
Simha JKC
over 12 years ago
Note: This was originally posted on 9th April 2013 at
http://forums.arm.com
thanks for sharing additional information.
@scott
: your suggested idea is not feasible as i am dealing with structures that are huge i.e., size is in 100s of KBs with many types of data types [size="2"]used in struct
[/size]
@archie:
i tried using "--remarks" it still does not help as it does not provide padding size and also the place where it is padding. below is the compile log
C:\c>armcc --remarks 1.c
"1.c", line 3: #1301-D: padding inserted in struct st
"1.c", line 3: #2530-D: padding added to end of struct st
"1.c", line 14: #181-D: argument is incompatible with corresponding format string conversion
printf ("sizeof (me) = %d \n",sizeof(me));
^
"1.c", line 16: Warning: #1-D: last line of file ends without a newline
}
^
1.c: 1 warning, 0 errors
C:\c>
recently i tried "fromelf" with option "--expandarrays" and even that is not helping me.
Cancel
Vote up
0
Vote down
Cancel
Children
No data