[Bug c++/31775] static object mangling conflicts with extern object

mueller at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Feb 29 13:57:00 GMT 2008



------- Comment #7 from mueller at gcc dot gnu dot org  2008-02-29 13:57 -------
how about 

extern "C" void abort();
extern "C" { static int i; }
int *p = &i;
int main()
{ 
  int i;
  { 
    extern int i;
    i = 1;
    *p = 2;
    if (i == 2)
      abort ();
  }
  return 0;
}

in this case, the "i" name should not be mangled, right?


-- 

mueller at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mueller at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31775



More information about the Gcc-bugs mailing list