DSPRelated.com
Forums

Align of Data for C6713

Started by Fabian November 11, 2004
Hello 
with #pragma DATA_ALIGN(VaribleName , 8); i cann align a global varible. 
But i have to align a local varible how do i do that?

Fabian
Fabian wrote:
> Hello > with #pragma DATA_ALIGN(VaribleName , 8); i cann align a global varible. > But i have to align a local varible how do i do that? > > Fabian
How local a variable? If you mean one declared inside a function then it goes on the stack, and getting data alignment would be difficult. If you mean local to your file then you can declare it static: static int myStaticVar[8]; will show up within the file but will not become a global symbol for linking. You may be able to declare it static within a function, as well -- in that case the variable scope will be inside the function but it will be allocated a permanent spot in memory. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Don't think that can be done by any pragmas. Local variables are put
on the stack and it is not known at compile time what the stack
alignment would be at any function call .
But if it necessary you can use the trick of creating an aligned
buffer(of smaller size) from a non-aligned buffer (of larger size).

Regards
Piyush

adler24@gmx.de (Fabian) wrote in message news:<84bca505.0411110122.7fb72e0@posting.google.com>...
> Hello > with #pragma DATA_ALIGN(VaribleName , 8); i cann align a global varible. > But i have to align a local varible how do i do that? > > Fabian