Hi, Since r262910, it was noticed that new -Walloca-larger-than= warnings started appearing when building the D frontend's standard library. These have been checked and verified as valid, and appropriate fixes will be sent on upstream.
As for the warning itself, as it is now default on, it would be preferable to be able control it. Given the choice between adding these options to the D frontend or moving them to common, I'd rather move them to common. Regards Iain. ---
gcc/ChangeLog * common.opt (-Walloca): Moved from common.opt. (Walloca-larger-than=): Likewise. (Wno-alloca-larger-than): Likewise. gcc/c-family/ChangeLog * c.opt (-Walloca): Move to common.opt. (Walloca-larger-than=): Likewise. (Wno-alloca-larger-than): Likewise. diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index d6148380710..67da5a9e401 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -299,10 +299,6 @@ Wall C ObjC C++ ObjC++ Warning Enable most warning messages. -Walloca -C ObjC C++ ObjC++ Var(warn_alloca) Warning -Warn on any use of alloca. - Walloc-size-larger-than= C ObjC C++ LTO ObjC++ Var(warn_alloc_size_limit) Joined Host_Wide_Int ByteSize Warning Init(HOST_WIDE_INT_MAX) -Walloc-size-larger-than=<bytes> Warn for calls to allocation functions that @@ -316,16 +312,6 @@ Walloc-zero C ObjC C++ ObjC++ Var(warn_alloc_zero) Warning -Walloc-zero Warn for calls to allocation functions that specify zero bytes. -Walloca-larger-than= -C ObjC C++ LTO ObjC++ Var(warn_alloca_limit) Warning Joined Host_Wide_Int ByteSize Init(HOST_WIDE_INT_MAX) --Walloca-larger-than=<number> Warn on unbounded uses of -alloca, and on bounded uses of alloca whose bound can be larger than -<number> bytes. - -Wno-alloca-larger-than -C ObjC C++ LTO ObjC++ Alias(Walloca-larger-than=,18446744073709551615EiB,none) Warning --Wno-alloca-larger-than Disable Walloca-larger-than= warning. Equivalent to Walloca-larger-than=<SIZE_MAX> or larger. - Warray-bounds LangEnabledBy(C ObjC C++ LTO ObjC++) ; in common.opt diff --git a/gcc/common.opt b/gcc/common.opt index 4bf8de90331..fa68eda4213 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -538,6 +538,20 @@ Waggressive-loop-optimizations Common Var(warn_aggressive_loop_optimizations) Init(1) Warning Warn if a loop with constant number of iterations triggers undefined behavior. +Walloca +Common Var(warn_alloca) Warning +Warn on any use of alloca. + +Walloca-larger-than= +Common Var(warn_alloca_limit) Warning Joined Host_Wide_Int ByteSize Init(HOST_WIDE_INT_MAX) +-Walloca-larger-than=<number> Warn on unbounded uses of +alloca, and on bounded uses of alloca whose bound can be larger than +<number> bytes. + +Wno-alloca-larger-than +Common Alias(Walloca-larger-than=,18446744073709551615EiB,none) Warning +-Wno-alloca-larger-than Disable Walloca-larger-than= warning. Equivalent to Walloca-larger-than=<SIZE_MAX> or larger. + Warray-bounds Common Var(warn_array_bounds) Warning Warn if an array is accessed out of bounds.