This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: New warning option -Walloca
- From: Tom Tromey <tromey at redhat dot com>
- To: "Raksit Ashok" <raksit dot ashok at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 30 Aug 2007 17:15:52 -0600
- Subject: Re: [PATCH]: New warning option -Walloca
- References: <49886b970708301427r645c9dr58443fc40385cd6e@mail.gmail.com>
- Reply-to: tromey at redhat dot com
>>>>> "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?
Tom