Improper Access to a Union
ANSI 3.3.2.3 A member of a union object is accessed using a member of a different type
If a union of two types is declared and one value is stored, but the union is accessed with the other type, the results are unreliable.
For example, a union of float
and int
is declared. A float
value is stored, but the program later accesses the value as an int
. In such a situation, the value would depend on the internal storage of float
values. The integer value would not be reliable.
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for