Menu ▾ ▴

#71 OnBA: Undefined global data label bug

open
5
2005-05-09
2005-04-02
No

The following code revealed some small bugs in the
assembler.

void getFieldText_local([...]);
int na_local(int n);
char *aa_local(char* s);
//...
void foo()
{
getFieldText = getFieldText_local;
na = na_local;
sa=sa_local; //sa has been defined elsewhere as a
global function pointer variable
}

This compiles without a hitch, but when it assembles it
says "Undefined global data label na_lo". There are two
things wrong with this:
1) na_local is defined. It's off by one line (yes, I
did tests, it gives the line before the correct line)
2) it restricts the length of the label it's showing to
only 5 characters. It should be able to support any
number of characters dynamically.

Discussion

  • Nick Guenther

    Nick Guenther - 2005-04-02
    • labels: --> OnBoard Asm
     
  • Jerramy Gipson

    Jerramy Gipson - 2005-05-06

    Logged In: YES
    user_id=874495

    This problem happens with global variables, as well as
    functions.

    extern int X; //but I neglected to actaully instantiate this...
    void foo() {}
    void bar() { int Y = X; foo(); }

    I get "Undefined global data label foo_00". It took me a full
    day of swearing "IT'S RIGHT F****N THERE!" before I figured
    it out.

    What's even worse is if you have this:

    extern int X; //still not instantiated
    void bar() { int Y=X; }

    and nothing else in the file, you get "Undefined global data
    label $X%@*2$#" or something like that.

    I looked at the OnBoard.c code which is generating this
    error. It's horribly obscure, though I might try diving into it at
    somepoint.

     
  • Steve Little

    Steve Little - 2005-05-09
    • assigned_to: nobody --> boz_x
     
  • Steve Little

    Steve Little - 2005-05-09

    Logged In: YES
    user_id=583634

    I know what causes this bug, and will check in a fix in the
    next day or so. Very annoying.

     

Log in to post a comment.