EmbDev.net

Forum: ARM programming with GCC/GNU tools pragma for padding structure items?


Author: A. S. (aleksazr)
Posted on:

Rate this post
0 useful
not useful
I'm using a third-party header file that contains structures
with non-aligned items and GCC 4.6.0 gives me a bunch of
"padding struct to align" and "padding struct size" msgs.

How can I disable those warnings for that header file only?

Author: A. S. (aleksazr)
Posted on:

Rate this post
0 useful
not useful
I'm thinking something like:

#pragma dont_give_structure_warnings
#include "header.h"
#pragma do_give_structure_warnings

Author: Andreas B. (Guest)
Posted on:

Rate this post
0 useful
not useful
See GCC manual entry Diagnostic Pragmas (section 6.56.10 in 4.6.0 docs).

Author: A. S. (aleksazr)
Posted on:

Rate this post
0 useful
not useful
Thanks!

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.