ARM Technical Support Knowledge Articles

ALIGNMENT PROBLEM WITH VARIABLES WITH GNU

Applies to: GNU C Compiler for ARM

Answer


Information in this article applies to:


QUESTION

I 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?

ANSWER

The GNU compiler has an alignment problem with uninitialized data. There are two possible work-arounds:

SEE ALSO

Article last edited on: 2006-07-10 12:21:11

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential