Topic : FATAL ERROR C041

Forum : ST7/STM8

Original Post
Post Information Post
September 14, 2009 - 12:28pm
Guest

I'm getting this error:

FATAL ERROR C041 IN LINE 11 OF E:\Test\Main.c : (null) (00,00,00,00,00,00,9)

For the following code:

extern volatile unsigned char TestVar;

int main(void)
{
    unsigned char a, b, c, d, e, f;

    if ((a == 0) && ( b | TestVar | c | e | e | f))
    {
        a = TestVar;
    }
}

The error goes away if TestVar is not declared as volatile.

I'm using the latest IDE & ST7 Toolkit (just downloaded them). Target is ST72361AR6.

Replies
Post Information Post
+1
0
-1
September 15, 2009 - 9:24am
Raisonance Support Team

The error is fixed and tests are running.

Stéphane

+1
0
-1
September 15, 2009 - 10:07am
Guest

If I understand correctly, this will be fixed in the next release? In the meantime, is there any way to work around this?

+1
0
-1
September 15, 2009 - 2:30pm
Raisonance Support Team

Blasio,

The only workaround is to remove the volatile attribute. You can also use a temporary variable for the test. Temporary variable previously initialized with TestVar, but is like removing the volatile attribute!

Stéphane

PS: I'll send you a patch as soon as all tests pass.