Data Align Packed Struct
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-04-10 5:18 AM
Posted on April 10, 2014 at 14:18
I need to be sure that a struct I use has 32-bit alignment. My IDE (IAR) gives a preprocessor directive for this, which I am trying to use. However, the compiler keeps giving me warnings saying that I can't use this pragma here. Here is how I have used it within my header file where the struct is declared:
&sharppragma data_alignment = 4 typedef __packed struct { u8 data[1024]; } BLOCK8_STRUCT; Can anyone see anything wrong with what I'm trying to do? Thanks #stm32
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-04-10 6:15 AM
Posted on April 10, 2014 at 15:15
Hi
Looks to me like the code is trying do the pragma on a definition if the struct rather than on an instance of a struct.