This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/14236] dynamically-sized arrays break alloca()
- From: "aoliva at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Feb 2005 16:29:28 -0000
- Subject: [Bug middle-end/14236] dynamically-sized arrays break alloca()
- References: <20040221103623.14236.aoliva@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From aoliva at gcc dot gnu dot org 2005-02-14 16:29 -------
Yes, it is natural, once you look into the mechanisms used to implement the
features. However, if you focus on the definitions:
- memory allocated for dynamic-sized arrays is released at the time the array
goes out of scope
- memory allocated with alloca() is released at the time the function that calls
alloca() returns
then there's no reason to expect dynamic-sized arrays and alloca() to interfere
with each other.
I agree that implementing them in such a way that they don't interfere is
probably impossible with a single stack, but that still doesn't make it right.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14236