Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28334 Discussions

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

bucaioni__thomas
New Contributor I
1,092 Views

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

0 Kudos
1 Solution
mecej4
Black Belt
1,074 Views

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
mecej4
Black Belt
1,087 Views

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
bucaioni__thomas
New Contributor I
1,079 Views

Is there anything I can do about it?

0 Kudos
mecej4
Black Belt
1,075 Views

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.

0 Kudos
Reply