treewide: Apply nonstring attribute to unterminated strings

Applying the attribute silences the following error and allows
compilation with GCC 15.2.

  error: initializer-string for array of 'char' truncates NUL terminator but destination lacks 'nonstring' attribute

Change-Id: I33cf3219f34e297de03f67d3e73058b10930c9f8
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/90631
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
This commit is contained in:
Felix Singer 2025-12-28 18:20:31 +01:00 committed by Matt DeVillier
commit e57478e238
5 changed files with 6 additions and 6 deletions

View file

@ -8,7 +8,7 @@
/* This structure is embedded somewhere in the (uncompressed) bootblock. */
struct metadata_hash_anchor {
uint8_t magic[8];
uint8_t __nonstring magic[8];
struct vb2_hash cbfs_hash;
/* NOTE: This is just reserving space. sizeof(struct vb2_hash) may change between
configurations/versions and cannot be relied upon, so the FMAP hash must be placed

View file

@ -321,7 +321,7 @@ struct lb_gpio {
#define ACTIVE_HIGH 1
uint32_t value;
#define GPIO_MAX_NAME_LENGTH 16
uint8_t name[GPIO_MAX_NAME_LENGTH];
uint8_t __nonstring name[GPIO_MAX_NAME_LENGTH];
};
struct lb_gpios {

View file

@ -28,7 +28,7 @@ struct smm_relocation_params {
extern struct smm_relocation_params smm_reloc_params;
struct ied_header {
char signature[10];
char __nonstring signature[10];
u32 size;
u8 reserved[34];
} __packed;

View file

@ -82,8 +82,8 @@ struct edid {
u32 bytes_per_line;
int hdmi_monitor_detected;
char ascii_string[EDID_ASCII_STRING_LENGTH + 1];
char manufacturer_name[3 + 1];
char __nonstring ascii_string[EDID_ASCII_STRING_LENGTH + 1];
char __nonstring manufacturer_name[3 + 1];
};
enum edid_status {

View file

@ -441,7 +441,7 @@ void mb_pre_raminit_setup(sysinfo_t *); /* optional */
void mb_post_raminit_setup(void); /* optional */
struct blc_pwm_t {
char ascii_string[13];
char __nonstring ascii_string[13];
int pwm_freq; /* In Hz */
};
int get_blc_values(const struct blc_pwm_t **entries);