On 07/11/2016 11:08 AM, Martin Sebor wrote:
Hey, I'm all for different options. It would definitely be easier for
me :). I wast trying really hard to use -Wvla= and keep the current
-Wvla meaning the same. Though I see your point about using -Wvla* but
using different variables for representing -Wvla and -Wvla=blah.
The easiest thing would be:
-Wvla: Current behavior (warn on everything).
-Wvla-larger-than=xxxx: Warn on unbounded VLA and bounded VLAs > xxxx.
-Walloca: Warn on every use of alloca (analogous to -Wvla).
-Walloca-larger-than=xxxx: Warn on unbounded alloca and bounded allocas
> xxxx.
This seems straightforward and avoids all the overloading you see. Would
this be ok with everyone?
I like the consistency.
Given the common root with -Wlarger-than=N, what do envision the effect
of setting -Wlarger-than=N to be on the two new options?
FWIW, I tend to view -Wlarger-than= and certainly -Wframe-larger-than=
not warning on alloca larger than N as a defect. It could be fixed by
simply hooking -Walloca-larger-than= up to it.
I'm not touching any of these independent options. -Wvla-larger-than=
and -Walloca-larger-than= will be implemented independently of whatever
-Wlarger-than= and -Wframe-larger-than=. Any problems with these last
two options can be treated indpendently (PRs).
Aldy