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

C274 - absolute specifier illegal

I am trying to put the software version number (a string) in the code flash at a specific location. When I leave off the "_at_" specifying the address, it works just fine. When I include the "_at_" I get the following error message:

*** ERROR C274 IN LINE 39 OF MAIN.C: 'text': absolute specifier illegal

The line of code is:
char code text[20] _at_ 0x7d00 = "Hello World\n";

This line if code is right out of Keil's C251 User's Guide. I'm using an 8051 (C51 compiler) so perhaps there is a limitation there.

Oddly enough, if I remove the initialization, as below, it compiles just fine.
char code text[20] _at_ 0x7d00;

Any ideas?

Parents
  • Cannot be done. Just read the User's Guide:

    The following restrictions apply to absolute variable location using the _at_ keyword:

    1. Absolute variables cannot be initialized.
    2. Functions may not be located at an absolute address.
    3. Bit variables may not be located at an absolute address.

    Perhaps I can put this in its own source file and locate the segment.

Reply
  • Cannot be done. Just read the User's Guide:

    The following restrictions apply to absolute variable location using the _at_ keyword:

    1. Absolute variables cannot be initialized.
    2. Functions may not be located at an absolute address.
    3. Bit variables may not be located at an absolute address.

    Perhaps I can put this in its own source file and locate the segment.

Children