This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: gcc/gcc ChangeLog Makefile.in fixinc/Makefile. ...
- From: Bruce Korb <bkorb at ellen dot veritas dot com>
- To: gcc-patches at gcc dot gnu dot org, "Zack Weinberg" <zack at codesourcery dot com>
- Date: Wed, 09 Jul 2003 09:27:02 -0700
- Subject: Re: gcc/gcc ChangeLog Makefile.in fixinc/Makefile. ...
- Reply-to: bkorb at ellen dot veritas dot com
Zack wrote:
> I am not clear on the allocation pattern in regex.c, because the file
> is very complicated and hides stuff behind lots of macros, but all
> the match primitives are structured like this:
>
> match()
> {
> setup work
> match_internal()
> #ifdef C_ALLOCA
> alloca(0);
> #endif
> }
As long as ``setup work'' doesn't involve calls to alloca,
then the problem is solved.
> If the problem recurs, we could just stick an alloca(0) call into the
> loop in fixincludes.
Look at the preprocessed code to check. I'd rather see match reworked:
> match( .... )
> {
> #ifdef C_ALLOCA
> static int allocating_match( .... );
> int res = allocating_match( .... );
> alloca(0);
> return res;
> }
> static int allocating_match( .... )
> {
> #endif
> setup work
> match_internal()
> }
It should not be the problem of a regex user to know, understand
and compensate for misuse of memory management by regex. I suspect
that is what the ``#ifdef C_ALLOCA'' is about.
- Bruce
P.S. I seem to be experiencing problems getting my email from gnu.org.
I'll have to chase that when I have a chance