public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Add a new warning option -Wstrict-flex-array
@ 2022-11-08 14:51 Qing Zhao
  2022-11-08 14:51 ` [PATCH 1/2] Change the name of array_at_struct_end_p to array_ref_flexible_size_p Qing Zhao
  2022-11-08 14:51 ` [PATCH 2/2] Add a new warning option -Wstrict-flex-arrays Qing Zhao
  0 siblings, 2 replies; 15+ messages in thread
From: Qing Zhao @ 2022-11-08 14:51 UTC (permalink / raw)
  To: rguenther, joseph; +Cc: gcc-patches, keescook, siddhesh, Qing Zhao


This patch serie include two changes:
  1. Change the name of array_at_struct_end_p to array_ref_flexible_size_p.
  2. Add a new warning option -Wstrict-flex-arrays and at the same time
keep -Warray-bounds unchanged from -fstrict-flex-arrays.

The new warning -Wstrict-flex-arrays is implemented at the same place as 
-Warray-bounds. Since we need to keep the old behaviors of
-Warray-bounds=[1|2], we refactor the routine
"array_bounds_checker::check_array_ref" to make it work for both
-Warray-bounds and -Wstrict-flex-arrays.  

if -Warray-bounds, -Wstrict-flex-arrays, -fstrict-flex-arrays presents
at the same time:
  A. -Warray-bounds will be not controlled by -fstrict-flex-arrays;
  B. -Wstrict-flex-arrays will be controled by -fstrict-flex-arrays;
  C. both -Warray-bounds and -Wstrict-flex-arrays will report warnings
     according to it's own rules.

bootstrapped and regression tested on both x86 and aarch64. no issue.
Okay for commit?

thanks.

Qing



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-11-24  6:45 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-08 14:51 [PATCH 0/2] Add a new warning option -Wstrict-flex-array Qing Zhao
2022-11-08 14:51 ` [PATCH 1/2] Change the name of array_at_struct_end_p to array_ref_flexible_size_p Qing Zhao
2022-11-09  7:57   ` Richard Biener
2022-11-09 15:50     ` Qing Zhao
2022-11-08 14:51 ` [PATCH 2/2] Add a new warning option -Wstrict-flex-arrays Qing Zhao
2022-11-15 15:41   ` Qing Zhao
2022-11-18 13:14   ` Richard Biener
2022-11-18 15:19     ` Qing Zhao
2022-11-18 16:31       ` Kees Cook
2022-11-21 15:02         ` Qing Zhao
2022-11-22  8:16           ` Richard Biener
2022-11-22 14:10             ` Qing Zhao
2022-11-22 15:02               ` Qing Zhao
2022-11-22 17:17                 ` Kees Cook
2022-11-24  6:45                   ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).