Attention is currently required from: Angel Pons, Nico Huber.
Arthur Heymans has posted comments on this change by Arthur Heymans. ( https://review.coreboot.org/c/coreboot/+/84042?usp=email )
Change subject: soc/intel/pmclib.c: Work around compiler bug -Werror=stringop-overread ......................................................................
Patch Set 7:
(1 comment)
File src/soc/intel/common/block/pmc/pmclib.c:
https://review.coreboot.org/c/coreboot/+/84042/comment/ed5e56a5_3602bb3f?usp... : PS7, Line 104: for (i = num_bits - 1; i >= 0; i--) {
I don't get it, it should never enter the loop body with `num_bits == 0`, right? On first sight, this looks like a compiler bug? What did it complain about specifically?
src/soc/intel/common/block/pmc/pmclib.c:355:17: error: 'print_num_status_bits' reading 4 bytes from a region of size 0 [-Werror=stringop-overread] 355 | print_num_status_bits(array_size, gpe_sts, sts_arr); | ^ src/soc/intel/common/block/pmc/pmclib.c:355:17: note: referencing argument 3 of type 'const char * const[0:]' src/soc/intel/common/block/pmc/pmclib.c: In function 'smm_southbridge_clear_state': src/soc/intel/common/block/pmc/pmclib.c:96:13: note: in a call to function 'print_num_status_bits' 96 | static void print_num_status_bits(int num_bits, uint32_t status,
Changing the signature of the function from an array to a pointer is a cleaner solution it seems.