This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: Add a new option -Wvariable-length-array
(Take this as my personal opinion, maintainers may actually think different).
+@item -Wvariable-length-array
+@opindex Wvariable-length-array
+@opindex Wno-variable-length-array
+Warn if a variable length array is used, independent of @option{-pedantic}.
+
I think this should said ". This option is also enabled by
@option{-pedantic}."
instead of ", independent of @option{-pedantic}."
Also, I think that tests for "-pedantic-errors -Wvariable-length-array
" and "-pedantic -Wno-variable-length-array" would be appropriate.
(What happens then?) Also, have you checked what happens with just
"-std=c89" ?
+Wvariable-length-array
+C ObjC C++ ObjC++ Var(warn_vla)
+Warn if a variable length array is used
+
The typical name for the variable associated to warning option -Wx-x-x
is warn_x_x_x. I think it would be good to keep this convention and
use warn_variable_length_array instead of warn_vla.
+ if (TREE_CONSTANT (size))
+ warning (OPT_Wvariable_length_array,
+ "The size of array %qs can"
+ "%'t be evaluated", name);
+ else
+ warning (OPT_Wvariable_length_array,
+ "Variable length array %qs is used",
+ name)
Most (all?) warning messages begin with lowercase (except for those
where the first letter is part of an acronym).
Cheers,
Manuel.