On 11 July 2016 at 11:10, Aldy Hernandez <al...@redhat.com> wrote: > On 07/10/2016 07:41 PM, Manuel López-Ibáñez wrote: >>> >>> +Walloca >>> +LangEnabledBy(C ObjC C++ ObjC++) >>> +; in common.opt >>> + >>> +Walloca= >>> +LangEnabledBy(C ObjC C++ ObjC++) >>> +; in common.opt >>> + >> >> >> I'm not sure what you think the above means, but this is an invalid use >> of LangEnabledBy(). (It would be nice if the .awk scripts were able to >> catch it and give an error.) > > > I was following the practice for -Warray-bounds in c-family/c.opt: > > Warray-bounds > LangEnabledBy(C ObjC C++ ObjC++,Wall) > ; in common.opt > > Warray-bounds= > LangEnabledBy(C ObjC C++ ObjC++,Wall,1,0) > ; in common.opt
The ones you quoted mean: For that list of languages, -Warray-bounds is enabled by -Wall. https://gcc.gnu.org/onlinedocs/gccint/Option-properties.html#Option-properties But the entries that you added do not specify an option. It should give an error by the *.awk scripts that parse .opt files. I'm actually not sure what the scripts are generating in your case. > I *thought* you defined the option in common.opt, and narrowed the language > variants in c-family/c.opt. ?? No, options that are language specific just need to be defined for the respective FEs using the respective language flags: Wvla is an example of that. It doesn't appear in common.opt. Adding language flags to a common option is just redundant (again, this is not what LangEnabledBy is doing). Cheers, Manuel.