|
|||||||||||
Technical Support Support Resources
Product Information |
GCC: Alignment Problem with GNU VariablesInformation in this article applies to:
QUESTIONI have declared just a few variables in my application, but the data space seems to be quickly used up. When I define the following variables, it appears that there are big gaps in the memory layout: int ival; short sval; long lval; What is the reason for that? ANSWERThe GNU compiler has an alignment problem with uninitialized data. There are two possible workarounds:
Note: There have been many different variants of the GCC compiler for ARM devices. Modern versions of Keil still support the GCC compiler, but now uses the GNU Arm Embedded Toolchain. To use this toolchain with Keil, see GCC: Using a GNU GCC Compiler Toolchain in the IDE. SEE ALSOLast Reviewed: Monday, December 21, 2020 | ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.