[cc65] Constant initializers

From: Stefan <vorsichtphysiker1gmx.net>
Date: 2013-02-15 07:57:23
Why does this work?

asm.s:

.EXPORT _data = *

.BYTE 1,2,3,4,5

.EXPORT _data_size = *-_data

main1.c:

extern unsigned char data[];
extern void data_size;

void main(void)
{
  static unsigned int ds = (unsigned int)&data_size;
}

and this not (non constant initializer error):

main2.c:

extern unsigned char data[];
extern void data_size;

void main(void)
{
  static unsigned char ds = (unsigned char)&data_size;
}
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Feb 15 07:57:33 2013

This archive was generated by hypermail 2.1.8 : 2013-02-15 07:57:37 CET