Suhaas Koparde

Memory allocation for float constant

Discussion created by Suhaas Koparde on Jul 29, 2008
Latest reply on Aug 5, 2008 by CrasyCat

I am using Codewarrior 4.6 build 6350 for MC9S12A128. I am using float constant’s arrays in my code as:

 

const float c_POL_0[4] = {-5.78917222e-06, +2.50809493e-03, +2.22793687e+00, -2.42091388e+02};

const float c_POL_1[4] = {+1.01890899e-06, +6.30461601e-04, +2.40305016e+00, -2.47634281e+02};

const float c_POL_2[4] = {+2.14757889e-06, -2.76439182e-04, +2.64911809e+00, -2.70148753e+02};

 

const float c_LIN[3] =

     {     100.000,

             260.785,

          LIMIT_MAX  };

 

While debugging the code, I found that compiler generates the memory addresses for c_POL_0 and c_LIN only. It does not generate memory addresses for c_POL_1 and c_POL_2. I checked this in .map file generated by the compiler. I am not using any optimizations for the compiler. What could be the reason? Please clarify.

 

Thanks in advance.

Outcomes