|
|||||||||||
Technical Support Support Resources
Product Information |
GENERAL: Are Anonymous Structures Supported?Information in this article applies to:
SYMPTOMSDoes the Keil Compiler support anonymous structure definitions inside a union? For example:
CAUSEThe problem here is that the structure in your example is not given a structure member name. Therefore, in standard C, there is no way to access it. RESOLUTIONIf you change the example to the following it will work.
STATUSNote that anonymous structures are a Microsoft variant of C. This is not an ANSI C compatible construct. MORE INFORMATIONThe following information was copied from the Microsoft support web site. Anonymous Structures Microsoft Specific : A Microsoft C extension allows you to declare a structure variable within another structure without giving it a name. These nested structures are called anonymous structures. C++ does not allow anonymous structures. You can access the members of an anonymous structure as if they were members in the containing structure. Refer to Structure Declarations for more information. Last Reviewed: Thursday, February 25, 2021 | ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.