Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
device_mmio: Fixed initialization of anonymous union on legacy compilers
An anonymous union is a feature of the C language which allows a union declared within a struct to be declared without a name: struct foo { union { int a; char b; }; }; A struct containing an anonymous union may be initialized in either of the following ways: /* Form A */ struct foo test = { .a = 1234 }; /* Form B */ struct foo test2 = { { .a = 1234 } }; Before the release of C11 (which became available in GCC 4.7.1), anonymous unions were only supported by GNU extensions to the C language: GNU89 or GNU99. Support for Form A of anonymous union initialization was added in GCC 4.6.1. Older version only support Form B of the above example. This patch improves compatiblity with legacy versions of GCC by converting an instance of anonymous struct initialization from Form A to Form B. Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
- Loading branch information