forked from Imagelibrary/rtems
bsps/*acpi*: Address unterminated string warnings
The ACPI source has multiple tables where a Name field is defined. The name field is a character array with a length of 4. All of the string initializers are four characters plus a NUL. The code is careful to use strn*() functions and intentionally avoids assuming there is space for the NUL. With lots of entries in the various arrays, this was clearly a design decision to save space. This was caught by GCC's -Wunterminated-string-initialization warning. The solution used is to use the "nonstring" attribute recommended by the GCC manual. Closes #5329
This commit is contained in:
committed by
Gedare Bloom
parent
78e050f603
commit
ad60ce8c2c
@@ -480,6 +480,9 @@ ACPI_STATUS (*ACPI_INTERNAL_METHOD) (
|
||||
*/
|
||||
typedef struct acpi_name_info
|
||||
{
|
||||
#ifdef __rtems__
|
||||
__attribute__ ((nonstring))
|
||||
#endif /* rtems */
|
||||
char Name[ACPI_NAMESEG_SIZE];
|
||||
UINT16 ArgumentList;
|
||||
UINT8 ExpectedBtypes;
|
||||
@@ -568,6 +571,9 @@ typedef ACPI_STATUS (*ACPI_OBJECT_CONVERTER) (
|
||||
|
||||
typedef struct acpi_simple_repair_info
|
||||
{
|
||||
#ifdef __rtems__
|
||||
__attribute__ ((nonstring))
|
||||
#endif /* rtems */
|
||||
char Name[ACPI_NAMESEG_SIZE];
|
||||
UINT32 UnexpectedBtypes;
|
||||
UINT32 PackageIndex;
|
||||
|
||||
@@ -169,6 +169,9 @@ ACPI_STATUS (*ACPI_REPAIR_FUNCTION) (
|
||||
|
||||
typedef struct acpi_repair_info
|
||||
{
|
||||
#ifdef __rtems__
|
||||
__attribute__ ((nonstring))
|
||||
#endif /* rtems */
|
||||
char Name[ACPI_NAMESEG_SIZE];
|
||||
ACPI_REPAIR_FUNCTION RepairFunction;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user