- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apparently, some fields are misaligned but in the source code the indentation is fine. What is the meaning of misalignment?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You may be able to rearrange the order of the elements in the structure and add padding (or remove attributes that inhibit padding) to mitigate the alignment problem.
You can use compiler options to turn off the warning.
Unless you have conducted studies to establish that the misalignment problem is significant, however, I'd suggest that you take note of the issue and put it aside.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The warning is about misalignment of data in memory when your program is running and accessing the memory locations occupied by members of the structure, not about the alignment of the characters of the source code in a text editor!
Regarding the issues related to misalignment, see, for example, https://en.wikipedia.org/wiki/Data_structure_alignment .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You may be able to rearrange the order of the elements in the structure and add padding (or remove attributes that inhibit padding) to mitigate the alignment problem.
You can use compiler options to turn off the warning.
Unless you have conducted studies to establish that the misalignment problem is significant, however, I'd suggest that you take note of the issue and put it aside.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page