This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: new pass to warn on questionable uses of alloca() and VLAs
- From: Jeff Law <law at redhat dot com>
- To: Manuel López-Ibáñez <lopezibanez at gmail dot com>, Aldy Hernandez <aldyh at redhat dot com>, Martin Sebor <msebor at gmail dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Martin Sebor <msebor at redhat dot com>
- Cc: Andrew MacLeod <amacleod at redhat dot com>
- Date: Tue, 19 Jul 2016 11:47:48 -0600
- Subject: Re: RFA: new pass to warn on questionable uses of alloca() and VLAs
- Authentication-results: sourceware.org; auth=none
- References: <577F9301.10205@redhat.com> <5782C7A3.9050308@gmail.com> <578917C0.4000809@redhat.com> <578AE85D.2030903@gmail.com>
On 07/17/2016 09:52 AM, Manuel López-Ibáñez wrote:
+ if (is_vla)
+ gcc_assert (warn_vla_limit > 0);
+ if (!is_vla)
+ gcc_assert (warn_alloca_limit > 0);
if-else ? Or perhaps:
Shouldn't really matter, except perhaps in a -O0 compilation. Though I
think else-if makes it slightly clearer.
gcc_assert (!is_vla || warn_vla_limit > 0);
gcc_assert (is_vla || warn_alloca_limit > 0);
Would be acceptable as well. I think any of the 3 is fine and leave it
to Aldy's discretion which to use.
Jeff