This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

error C127: invalid storage class

Hello!

I have transfered my project from uVision to uVision2. The IDE has the compiler C51 V7.06 and the linker BL51 V5.03.

If I rebuilt my target, the compiler displays an error-message for all functions.
This occurs, even if a library function is used.

"error C127: invalid storage class"


The error-list contains an explanation, which I do not understand:


"An object was declared with an invalid
memory space specification. This occurs
if an object is declared with storage-
class of auto or register outside of a
function."


I dont know, why these error is created, because of I included the command "#pragma LARGE" and set even "Options for target" to "LARGE memory model". "Off Chip Xdata
memory" is set to 64k.


My project has the following structure (shortend). There could be parameters too.

// header-file: test.h

    // declaration of test()
    extern  void  test( void );


// main-file: main.c

    #pragma  LARGE

    // include header-file
    #include "test.h"

    void main( void )
    {
         // call test()
         test();
    }


// source-file: test.c

    #pragma LARGE

    void test( void )
    {
         // test source code
    }

Of course, I modified my program, but I didnt turn it free from these bug. Under uVision it works without errors.

Thank you for reply!

0