name-mangling bug

Martin von Loewis
Fri Sep 25 14:24:00 GMT 1998

> When I tried to link my application, the linker complained of one
> undefined function.  Further investigation showed that the name-mangler
> added an extra underscore to the name of one of my functions, i.e., it
> named the function "eatwhite_" instead of "eatwhite" leading to the
> linker error.  An example of this behavior is attached.

Thanks for your bug report. Here is a patch.

Mark, it seems that numeric_output_need_bar needs to be cleared in
quite some more places, after writing '_' (e.g. what if it is set
while mangling template parameters with H<foo>_).

I can't commit this, anyway, because I'm going on vacation, so please
review if you can.


1998-09-25  Martin von Löwis  <>

	* method.c (build_decl_overload_real): Clear
	numeric_output_need_bar after __.

Index: method.c
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/method.c,v
retrieving revision 1.76
diff -c -p -r1.76 method.c
*** method.c	1998/09/21 13:34:10	1.76
--- method.c	1998/09/25 21:01:20
*************** build_decl_overload_real (dname, parms, 
*** 1527,1532 ****
--- 1527,1533 ----
       and figure out its name without any extra encoding.  */
    OB_PUTC2 ('_', '_');
+   numeric_output_need_bar = 0;
    if (tparms)

More information about the Gcc-patches mailing list