------- Comment #2 from dgraham at nortel dot com 2005-11-13 20:17 -------
Subject: Re: Duplicate constructors with -fmudflap
On Sun, Nov 13, 2005 at 04:20:06PM -0000, pinskia at gcc dot gnu dot org wrote:
>
> ------- Comment #1 from pinskia at gcc dot gnu dot org 2005-11-13 16:20
> -------
> Do you have an example source?
Sure:
-------- begin foo.c ---------
static int foo;
int main(int argc, char **argv)
{
printf("%d\n", foo);
}
-------- end foo.c ---------
Compile with "gcc -g -fmudflap foo.c -lmudflap".
Put a breakpoint on _GLOBAL__I_0_main. It will be hit twice.
I forgot to mention that I'm talking about static constructors only.
I don't think this is a serious problem for mudflap, except maybe for
its performance implications (all static data gets registered twice),
but there may be other uses of constructors in C where having those
constructors called twice would be a serious problem.
--Doug.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24830