#527 Compile Error when trying to break out of while loop.

closed-fixed
5
2013-05-25
2003-06-10
Anonymous
No

compile using: sdcc -c test.c
message: error: 'breakStack' internal stack empty

code:
unsigned char a;
unsigned char b;
unsigned char c;
unsigned char d;

void uart_send(unsigned char *string)
{
a = 0;
while( string[a]!=0);
{
if (b == c)
{
d = 1;
break;
}
a++;
}
}

Discussion

  • Nobody/Anonymous

    Logged In: NO

    m2shimiz@engmail.uwaterloo.ca

     
  • Jesus Calvino-Fraga

    • status: open --> closed
     
  • Jesus Calvino-Fraga

    Logged In: YES
    user_id=603650

    The problem is in your code. There is no place where to
    break to since you left a ';' after the while:

    while( string[a]!=0)
    {
    ...

    Jesus

     
  • Borut Ražem

    Borut Ražem - 2003-06-15
    • status: closed --> open
     
  • Borut Ražem

    Borut Ražem - 2003-06-15

    Logged In: YES
    user_id=568035

    I think that this IS a bug: massages as 'breakStack' internal
    stack empty should be considered as compiler internal errors
    and are thrown by the stack handling routine as a fatal error.
    The complier should detect internal stack errors BEFORE the
    error actually happen (e.g. test if the stack is empty before
    pop-ing the value), report the error and continue with
    compilation, as is the case for other compile errors / warnings.

    So I'm reopening this bug in agreement with Jesus, who closed
    it.

     
  • Erik Petrich

    Erik Petrich - 2003-12-19

    Logged In: YES
    user_id=635249

    Fixed. See ChangeLog 1.539 for the relevant files updated.

     
  • Erik Petrich

    Erik Petrich - 2003-12-19
    • milestone: --> fixed
    • assigned_to: nobody --> epetrich
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks