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.

__attribute__(aligned) problem in Header File

Hi,

CCS Studio V5.5.00077 shows a "Syntax error" (question mark on the side and orange underlined, please see picture below) on the following line in a header file:

extern u8_t memp_memory_PBUF_POOL_base[] __attribute__((aligned(SOC_CACHELINE_SIZE_MAX)));


Strange thing is, the code builds without a problem. No error message building the code. GCC extension support is enabled in the ARM compiler options. We use V5.0.5 Code Generation Tools from TI.



I can not see any problem with this code line. Does an expert from TI has an idea?

Thanks and best regards,
Patrick

  • Patrick,

    The "syntax error" you are referring to is likely coming from the CCS Code Analysis and not from the TI compiler. It should be safe to ignore it from a functional standpoint. However, I can't seem to recreate the CCS syntax error by using the "aligned" attribute. Could you send a small test project that demonstrates the issue? It might even be something already addressed in CCSv6 but I can confirm that if you can send us a test case.

  • AartiG,

    Attached is a example project. If I include cc.h in the main.c than CCS displays the syntax error. If I remove the include in main.c than CCS removes the syntax error as well. Compiling and Linking is fine.

    I did not test it in CCS V6 because we have other issues with CCS V6 and I do not want to switch now.

    7536.TestProject.zip

  • Thank you for the example project and sorry about the delayed reply.

    I can reproduce the behavior with CCS 5.5 but do not see it in CCS 6.0.1. So it looks like it is fixed in the newer version of Eclipse.

    Since you are not moving to CCSv6 right now, if you really wish to remove the Syntax error in CCS 5.5, you can disable the indexer for this project. Go to Project Properties, click on Show Advanced Settings at the bottom, go to C/C++ General->Indexer, check the box for "Enable project specific settings" and then uncheck the box for "Enable Indexer". This will disable it just for this project rather than all projects in the workspace.

    I also found that changing the definition of SOC_CACHELINE_SIZE_MAX in soc_AM335x.h from (64) to 64 also makes the error go away. With this change, you wouldn't need to disable the indexer.

     

  • AartiG,

    Thanks for analyzing this issue. As we know now that the indexer in Eclipse of CCS V5.5 is doing something wrong and it's not related to our code it's fine. Interesting that removing the paranthesis change the behaviour of the indexer.

    Thanks and best regards,
    Patrick