On 01/31/2017 10:57 AM, Martin Sebor wrote:
On 01/31/2017 03:50 AM, Aldy Hernandez wrote:
On 01/24/2017 03:07 PM, Martin Sebor wrote:
Hi Martin.
Thank you for taking care of this.
+ <li><p>The <code>-Walloca-larger-than=<i>size</i></code> option
detects
+ calls to the <code>alloca</code> function whose argument may exceed
+ the specified <code><i>size</i></code>.
+ <code>-Walloca-larger-than</code> is not included in either
+ <code>-Wall</code> or <code>-Wextra</code> and must be explicitly
+ enabled.</p>
You should probably document that we warn, not just on arguments that
exceed a specific threshold, but arguments that are unbounded or unknown
at compile time:
foo (size_t n)
{
...
p = alloca(n);
...
}
Sure. I added a bit of text to the end of the sentence that should
hopefully make that clearer. The updated patch is attached.
<li><p>The <code>-Walloca-larger-than=<i>size</i></code> option
detects
calls to the <code>alloca</code> function whose argument either may
exceed the specified <code><i>size</i></code>, or that is not known
to be sufficiently constrained to avoid exceeding it.
I'd like to see an example, if possible. I'm a big fan of them :).
Pretty please :).