extern "C" typedefs

Mark Mitchell mark@markmitchell.com
Thu Oct 22 09:25:00 GMT 1998

>>>>> "Josh" == Josh MacDonald <jmacd@paris.CS.Berkeley.EDU> writes:

    Josh> This code compiles with every C compiler I've ever used, and
    Josh> also compiles with g++ 2.7.2.  I am running:

    Josh> Reading specs from
    Josh> /usr/local/lib/gcc-lib/i386-unknown-freebsd2.2.7/egcs-2.90.29/specs
    Josh> gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)

    Josh> I may be falling behind in the seemingly perpetual evolution
    Josh> of C++, but since this is in an extern "C" scope, it seems
    Josh> that it should accept it.  It complains:

Without commenting on your particular example, this premise is in
general false.  The stuff appearing in an `extern "C"' scope must
still be valid C++, according to the standard.  For example, 

  extern "C" void f();

is the same as:

  extern "C" void f(void);


  extern "C" void f(...);

Mark Mitchell 			mark@markmitchell.com
Mark Mitchell Consulting	http://www.markmitchell.com

More information about the Gcc-bugs mailing list