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.

DATA_ALIGN pragma error

Hi,

I am linking to a library containing the following declaration in a header file:

#pragma DATA_ALIGN(8);

const float MyArray[] = {
0.01f,

0.02f,

...

...

...

};

i get a compiler warning saying: 

warning: Error processing pragma DATA_ALIGN, verify format.

I am using the DATA_ALIGNs in other .cpp files of the library, but  i do not see an error there. Not sure what is going wrong with this one.

  • Welcome to the TI E2E forum. I hope you will find many good answers here and in the TI.com documents and in the TI Wiki Pages (for processor issues). Be sure to search those for helpful information and to browse for the questions others may have asked on similar topics (e2e.ti.com). Please read all the links below my signature.

    Moving this thread to TI compiler forum for faster and appropriate response. Thank you for your patience.

    Note: We strongly recommend you to create new e2e thread for your queries instead of following up on an old/closed e2e thread, new threads gets more attention than old threads and can provide link of old threads or information on the new post for clarity and faster response.

  • One thing to double check is that the file showing the problem is being compiled as a C++ file.  Usually that means it has the .cpp extension, but I think there are other ways to indicate how it should be compiled.  In this case since it is in a header file, you'll want to check that any source files that #include the header file, directly or indirectly, are being compiled as C++.

    If it is a C file rather than C++, the C syntax is slightly different:

    #pragma DATA_ALIGN ( symbol , constant )

  • Alternately, you can use GCC-style attributes:
    const float __attribute__((aligned(8))) MyArray[] = { 1.0f, ... };