Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
55 Views

warning #6379: The structure contains one or more misaligned fields.

Jump to solution

Apparently, some fields are misaligned but in the source code the indentation is fine. What is the meaning of misalignment?

0 Kudos

Accepted Solutions
Highlighted
Black Belt
37 Views

Re: warning #6379: The structure contains one or more misaligned fields.

Jump to solution

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.

View solution in original post

0 Kudos
3 Replies
Highlighted
Black Belt
50 Views

Re: warning #6379: The structure contains one or more misaligned fields.

Jump to solution

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 .

0 Kudos
Highlighted
42 Views

Re: warning #6379: The structure contains one or more misaligned fields.

Jump to solution

Is there anything I can do about it?

0 Kudos
Highlighted
Black Belt
38 Views

Re: warning #6379: The structure contains one or more misaligned fields.

Jump to solution

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.

View solution in original post

0 Kudos