One-element arrays are deprecated[1] and are being replaced with flexible array members in support of the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy(), correctly instrument array indexing with UBSAN_BOUNDS, and to globally enable -fstrict-flex-arrays=3. Replace one-element array with flexible-array member in struct hpet. This results in no differences in binary output. The use of struct hpet is never used with sizeof() and accesses via hpet_timers array are already done after explicit bounds checking. [1] https://github.com/KSPP/linux/issues/79
Unified · Split
| @@ -30,7 +30,7 @@ struct hpet { · 29 unmodified lines | |||
| 30 | unsigned long _hpet_compare; | 30 | unsigned long _hpet_compare; |
| 31 | } _u1; | 31 | } _u1; |
| 32 | u64 hpet_fsb[2]; /* FSB route */ | 32 | u64 hpet_fsb[2]; /* FSB route */ |
| 33 | } hpet_timers[1]; | 33 | } hpet_timers[]; |
| 34 | }; | 34 | }; |
| 35 | 35 | ||
| 36 | #define hpet_mc _u0._hpet_mc | 36 | #define hpet_mc _u0._hpet_mc |