11.4.3 V.2.03 and Later Versions (Compatibility with Versions between 1.00 and 2.02)
(1) | Const-type Static Variables without Initial Values |
In versions before 2.02, const-type static variables with initial values were output first, but from this revision, const-type static variables are aligned in the data area in order of their definition regardless of the existence of initial values.
const int a=1;
const int b;
const int c=2;
|
[Result of compilation for versions before 2.02.00]
.SECTION C,ROMDATA,ALIGN=4
_a:
.lword 00000001H
_c:
.lword 00000002H ; The variables with initial values are output first.
_b:
.lword 00000000H
|
[Result of compilation for versions after 2.03.00]
.SECTION C,ROMDATA,ALIGN=4
_a:
.lword 00000001H
_b:
.lword 00000000H ; The variables are output in order of their definition
; regardless of the existence of initial values.
_c:
.lword 00000002H
|