This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: () in C++ (was Re: [PATCH] C and C++ ICEs)


Jason Merrill <jason@cygnus.com> said:
> >>>>> Nathan Sidwell <nathan@codesourcery.com> writes:
>  > So, Jason, what is your opinion about always treating
>  >         extern "C" void foo ();
>  >         extern "C" void (*ptr) ();
>  > as
>  >         extern "C" void foo (void);
>  >         extern "C" void (*ptr) (void);
>  > ?

> I'm opposed to it.  That feature is there to deal with C library headers
> that have not been updated to include proper prototypes, such as the X
> library headers on some systems.

The only thing extern "foo" specifies in C++ is linkage.  The function and
data declarations themselves must be C++. If you want K&R C syntax, do it
with an __extension__ perhaps?
-- 
Dr. Horst H. von Brand                       mailto:vonbrand@inf.utfsm.cl
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]