Prevent macro expansion of mblen

Jason Merrill jason@redhat.com
Sun Dec 31 06:10:00 GMT 2000


>>>>> "Gabriel" == Gabriel Dos Reis <gdr@codesourcery.com> writes:

> | > 	// file b.C part of a "C++"-program
> | > 	#include <cstdlib>
> | > 	extern "C" void f();
> | > 	void g() { f(); }
> | 
> | > We need a way to make the call to f() work.  Do you see what I'm
> | > trying to say?
> | 
> | Nope.  I really don't see why f() wouldn't work.  It seems to me it
> | would work just fine.

> You get a link-time error if mblen() has a C++ linkage -- that is one
> of the reasons why we want all C-funtions to have C linkage.

Why?  The C code would still call the C mblen.  It wouldn't hurt for there
to also be an mblen with C++ linkage, though I don't think it would do much
good, either...

Jason


More information about the Libstdc++ mailing list