This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: New warning option -Walloca
On 31/08/2007, Tom Tromey <tromey@redhat.com> wrote:
> >>>>> "Raksit" == Raksit Ashok <raksit.ashok@gmail.com> writes:
>
> Raksit> This patch adds a "-Walloca" option to gcc. If this warning is
> Raksit> enabled, gcc will emit a warning on encountering "alloca"
> Raksit> calls. This option could be used to enforce coding conventions
> Raksit> that forbid use of alloca. For example:
> Raksit> http://www.dc.turkuamk.fi/docs/gnu/awk/gawk_21.html
> Raksit> http://www-unix.mcs.anl.gov/mpi/mpich/adi3/mpich2/node316.htm
>
> If alloca is forbidden, couldn't you simply poison the identifier?
> I suppose that won't work if you have a system header that defines a
> macro which expands to use alloca. But does that happen?
>
On the contrary, I suppose it will work if you poison the identifier
before including any system headers. Doesn't it?
Raksit, if "poison" doesn't work for you, let's us know why and let us
see if we can fix that instead. Perhaps it is "poison" that needs to
be fixed.
Cheers,
Manuel.