Arm Community
Site
Search
User
Site
Search
User
Groups
Arm Research
DesignStart
Education Hub
Graphics and Gaming
High Performance Computing
Innovation
Multimedia
Open Source Software and Platforms
Physical
Processors
Security
System
Software Tools
TrustZone for Armv8-M
中文社区
Blog
Announcements
Artificial Intelligence
Automotive
Healthcare
HPC
Infrastructure
Innovation
Internet of Things
Machine Learning
Mobile
Smart Homes
Wearables
Forums
All developer forums
IP Product forums
Tool & Software forums
Support
Open a support case
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Developer Community
Tools and Software
Software Tools
Jump...
Cancel
Software Tools
Arm Development Studio forum
armcc
Tools, Software and IDEs blog
Forums
Videos & Files
Help
Jump...
Cancel
New
Replies
2 replies
Subscribers
126 subscribers
Views
2538 views
Users
0 members are here
Related
armcc
Offline
Simha JKC
over 7 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 ?
Offline
Simha JKC
over 7 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
Up
0
Down
Reply
Cancel
Offline
Scott Douglass
over 7 years ago
Note: This was originally posted on 8th April 2013 at
http://forums.arm.com
I don't think there is a way to get the compiler to be more specific about the padding. The structure layout rules are in section 4 of the ABI
http://infocenter.ar...042e/index.html
. You could manually add 'char dummy1;' members until the padding warnings go away and then you'll know that you've identified all of the padding.
Cancel
Up
0
Down
Reply
Cancel
More questions in this forum
By title
By date
By reply count
By view count
By most asked
By votes
By quality
Descending
Ascending
All recent questions
Unread questions
Questions you've participated in
Questions you've asked
Unanswered questions
Answered questions
Questions with suggested answers
Questions with no replies
Answered
FVP Debug problems for Blinky Example project on Cortex-M4
0
Fixed Virtual Platforms (FVPs)
Debugging
Cortex-M4
8787
views
2
replies
Latest
4 months ago
by
Sagittarius
Answered
Product license check-out for feature "platform_editor:202003" failed
0
ARM Development Suite (ADS)
DSTREAM
8746
views
2
replies
Latest
4 months ago
by
David DV
Suggested Answer
How to execute tag manipulation instructions in Cortex-A76 FVP
0
8589
views
2
replies
Latest
4 months ago
by
Stephen Theobald
Suggested Answer
Failed to debug hello world project on Cortex-A76
0
8593
views
1
reply
Latest
4 months ago
by
Stephen Theobald
Suggested Answer
DS-5: Unable to connect to USB-Blaster
0
8235
views
1
reply
Latest
4 months ago
by
Ronan Synnott
<
>
View all questions in Arm Development Studio forum