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

const integral values across modules and ROM placement

Hi,

I have the following code:

file1.h

extern const unsigned char c1;

file1.c

const unsigned char c1 = 25;

file2.c

const unsigned char c2 = c1 + 25;

According to the documentation www.keil.com/.../armccref_ciabaidh.htm both variables should be placed in ROM but this doesn't happen.

I found that the variable c2 is not put in ROM and RW-data increases by 4 bytes.

but when c1 is in the same module(same .c file) as c2, RW-data doesn't increase and RO-data increases instead.

Am I missing something ?

Thanks in advance :)

Parents
  • That is one of the problems with all compiler extensions in existence. People get expectations that all other compilers must support it. And that the compiler should have supported even more language extensions not covered in the "must" list of the language standard.

    Huge amounts of people look at gcc and then blame all other compilers for not "correctly" being able to compile their code.

Reply
  • That is one of the problems with all compiler extensions in existence. People get expectations that all other compilers must support it. And that the compiler should have supported even more language extensions not covered in the "must" list of the language standard.

    Huge amounts of people look at gcc and then blame all other compilers for not "correctly" being able to compile their code.

Children