Question:
I have a C++ header file with class declaration. Part of the declaration is a data member.
int a;
I need to ensure correct alignment. According to documentation I should be able to do the following.
int a __attribute__ ((aligned (8)));
However, I get an error.
".\foo.h", line 92: cc0065: error: expected a ";"
int a __attribute__ ((aligned (8)));
^
How can I use the variable alignment attribute?
===============================
Answer:
The GCC compatibility extensions are only available in C89 and C99 modes.They are not accepted in C++ dialect mode, unless enabled with the -g++ switch".
So please add '-g++' switch in to compiler > additional options in your C++ project before the build.
Please refer the CCES help path for more details.
CrossCore Embedded Studio 2.x.x > SHARC
Development Tools Documentation > C/C++ Compiler Manual for SHARC
Processors > Compiler > C/C++ Compiler Language Extension