#985 ?ASlink-Warning-Undefined Global

closed-fixed
Maarten Brock
5
2013-05-25
2005-09-18
micro_joe
No

The following
<code>
void main (void)
{
unsigned char i, z;
for (i=0; i < 9; i++)
{
z++;
}
}
</code>

when compiled gives the error:

P:\Current\SDCC\test>sdcc test.C

?ASlink-Warning-Undefined Global '_main_z_1_1'
referenced by module 'test'

Tool completed with exit code 1

Maarten Brock says:
"z is optimized into a register, but the register
cannot be initialized because you did not provide it
with an initial value.
This code should not "work" but it's valid C so it
should compile and link."

compiler version 2.5.0 #1020 (May 8 2005)

andy_cleeves@tiscali.co.uk

Discussion

  • Maarten Brock
    Maarten Brock
    2006-06-13

    Logged In: YES
    user_id=888171

    Fixed in SDCC 2.5.6 #4225.

     
  • Maarten Brock
    Maarten Brock
    2006-06-13

    • milestone: --> fixed
    • assigned_to: nobody --> maartenbrock
    • status: open --> closed-fixed