This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

On-stack memory alignment

Other Parts Discussed in Thread: OMAP-L138

I am using the TI C/C++ C6000 compiler, v7.3.1 on a C6748 in an OMAP-L138.

I would like to know if it is possible to specify alignment for a local array declared on the stack.    Using the DATA_ALIGN pragma on a local variable is not allowed.   Is there some other way?

Can I get the effect I want by declaring a double precision floating point variable, followed by my array, i.e.,

void foo()
{
  double foo;
  unsigned char double_aligned_array[256];
  .
  .

}

If this is effective, will I have to play games to make sure foo doesn't disappear when optimized, i.e., declare it volatile or some such thing?

(And yes, I know that declaring it global and using a DATA_ALIGN there will do it, but for various reasons I really want to ensure a local array's alignment, and I want to know if it is possible).

    Jay