Forum : ST7/STM8
Original Post
| Post Information | Post |
|---|---|
|
April 5, 2010 - 5:05pm
|
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: -- |
Does it matter whether or not optimization is enabled?
Optimization doesn't seem to make any difference. For reference, the invocation used is:
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).