This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to get rid of __ALIGN(4) syntax error in Eclipse?

Hello,

I'm working with FDS and I have declared a variable like this:

__ALIGN(4) static uint32_t data;

My code compiles and works correctly but Eclipse complains about the __ALIGN(4) and highlights it as a syntax error and shows errors everywhere where I use that variable, which is very frustrating.

I know this is an Eclipse issue, but I'd really appreciate it if someone could help me get rid of that annoying error. Is there any file I can include or anything I can do about it?

Parents
  • Hi,

    There is a header file called compiler_abstraciton.h located in SDK_folder\components\device . Inside it there are a bunch of redefines. Have you included this header file in your project? Do you know if the correct redefine is being used?

  • Hi Martin, I checked and explicitly added the file to the project (for Eclipse to index it) but it still shows up as an error. I see the `__ALIGN()` macro definition there, but it's not being used because somehow Eclipse says `defined(__GNUC__)` is false. Any suggestions?

  • Hi,

    Please make sure to enable CDT ARM Cross Built-in Compiler Settings in your project properties:

    and that __GNUC__ is included here:

  • Hi Martin,

    I just checked and the entry list in CDT ARM Cross GCC Built-in Compiler Settings is empty. I do have it "checked" but in the Entries menu it doesn't show anything.

Reply Children
  • Hi,

    Please make sure to stand at "source code level":

    Then make sure to check "CDT GCC Built-in Compiler Settings Cross ARM:

  • Hi Martin,

    I do have the CDT GCC Built-in Compiler Settings Cross ARM checked, but somehow there are still no entries there.

     

    I checked in another project and the entries are there, but for some reason in this project there are none. Do you have any idea how to solve this?

    The settings are checked like this on a project level, at source code level I don't see that menu: