Topic : RCSTM8 locks up during build

Forum : ST7/STM8

Original Post
Post Information Post
April 5, 2010 - 5:05pm
Guest

I've just received some (rather bad) code from a student, within which was the following:

#include 
#include 

/* Declaration of Ports: Inputs */

at PCDR^0 hbit iXhome;       //xhome sensor
at PCDR^3 hbit iYout;        //yout sensor



void delay1ms (void)
{

}


void main (void)
{

}

void prehoming (void)           //PRE HOMING SEQUENCE
{
        if(iYout==0)
        {
            step1;
        }
        else;
        do 
            {
            delay1ms;           
  //        warning            //push device on pedestal
            }
        while(iYout==0);
    
step1:      if(iXhome==1)
 //         break;            //piston x not homed call tech.
            else
            {
            
            }
}

With this code in place the compiler locks up and never finishes compilation. Not likely to be a common issue, but I thought I'd report it anyway.

Software Versions:
Ride7: 7.24.09.0251
RKit-STM8: 2.26.09.0317

--
Blasio

Replies
Post Information Post
+1
0
-1
April 6, 2010 - 6:23pm
Guest

Does it matter whether or not optimization is enabled?

+1
0
-1
April 7, 2010 - 8:23am
Guest

Optimization doesn't seem to make any difference. For reference, the invocation used is:

QUIET GENERATEDEPFILE CODE DB OJ(E:\Sorter\sorter.obj) PR(E:\Sorter\sorter.lst) PIN(C:\Program Files\Raisonance\Ride\Inc;C:\Program Files\Raisonance\Ride\Inc\ST7) O(3,SIZE) NOINITSTATICVAR SMALLOBJECT ET(INT)
+1
0
-1
April 8, 2010 - 2:24pm
Guest

Thanks for the report. We will fix it (but the fix will not be available in the very next version that is already finalized).
The issue is caused by a combination of several syntactic errors. Typically, adding any instruction after the last if-statement (if(iXhome==1)) will fix the problem. For example a null instruction (semicolon).