https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101836
--- Comment #38 from qinzhao at gcc dot gnu.org --- (In reply to James Y Knight from comment #37) > (In reply to qinzhao from comment #35) > > I think that -Wstrict-flex-arrays will need to be cooperated with > > -fstrict-flex-arrays=N, i.e, only when -fstrict-flex-arrays=N is presenting, > > -Wstrict-flex-arrays will be valid and report the warnings when see a [0], > > or [1], or any trailing array based on N: > > When -fstrict-flex-arrays is used, I'd expect the existing -Warray-bounds > warning to already emit diagnostics in the cases you list, because those > cases should no longer be special-cased to act as a FAM, and thus no longer > explicitly suppress it. yes, that's right. instead of adding a new -Wstrict-flex-arrays, we can also update the current -Warray-bounds to cooperate with the new -fstrict-flex-arrays to issue warnings according to the different level of strict-flex-arrays.