Why are all of my pragmas being ignored as "unknkown"?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Why are all of my pragmas being ignored as "unknkown"?

Jump to solution
1,379 Views
marcbunyard
Contributor IV

I'm using #pragma push / pop / define_section, etc.  and I keep getting

 

ignoring pragma -Wunknown-pragma.  Are they disabled somewhere?

Labels (1)
1 Solution
697 Views
marcbunyard
Contributor IV

Thanks for the GCC wake up.  I needed __attribute__ instead of #pragma.

View solution in original post

0 Kudos
4 Replies
697 Views
BlackNight
NXP Employee
NXP Employee

Pragmas depend on the compiler used. So which compiler are you using? gcc? which version?

0 Kudos
697 Views
marcbunyard
Contributor IV

Sorry.  Still messing with this one. CW 10.4 GCC.  I'm new to Code Warrior.

0 Kudos
698 Views
marcbunyard
Contributor IV

Thanks for the GCC wake up.  I needed __attribute__ instead of #pragma.

0 Kudos
697 Views
BlackNight
NXP Employee
NXP Employee

I'm using pragmas like

#pragma pack(push)

#pragma pack(1)

....

#pragma pack(pop)

and that works fine for me. Can you verify that you are using GCC pragmas (and not Keil/IAR ones)?

A useful link could be this one:

Pragmas - Using the GNU Compiler Collection (GCC)

0 Kudos