This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/19881] strange warning about alloca
- From: "bruno at clisp dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Feb 2005 21:44:00 -0000
- Subject: [Bug c/19881] strange warning about alloca
- References: <20050210204838.19881.sds@gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bruno at clisp dot org 2005-02-10 21:43 -------
The warning is not correct because
1) The code snippet uses alloca() and variable-size arrays for their respective purpose:
alloca() for storage that persists until the end of the function, and variable-size arrays
for storage that persists until the end of the block.
2) In the above sample, all 2 alloca() blocks and 2 variable-size arrays terminate their
lifetime at the same instruction. There are no instructions after the bar(...) function call
return; therefore a warning about a possible accidental use of the type_temp memory after
this point is pointless: the compiler could determine that there are no instructions any more.
We are asking for an easy way to turn off this warning, so that we can look at other, useful,
warnings.
This is not duplicate of PR 14236, but rather a complaint about the implementation of the fix
of PR 14236.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19881