Path: utzoo!attcan!uunet!mcsun!ukc!keele!nott-cs!gas From: gas@cs.nott.ac.uk (Alan Shepherd) Newsgroups: comp.lang.c++ Subject: extern "C" Message-ID: <1990Oct10.062518.23722@cs.nott.ac.uk> Date: 10 Oct 90 06:25:18 GMT Reply-To: gas@cs.nott.ac.uk (Alan Shepherd) Organization: Nottingham University Lines: 19 I've had several responses to my original question about extern "C". As a summary, I wanted to know why it was necessary to prototype functions within the scope of an extern "C" declaration rather than treat 'extern "c" foo()' as an old-style C compiler would. Most people have basically said that it's necessary for prototyping. Someone pointed out that 'extern "C" foo(...)' would do what I wanted, but this syntax failed for declaring a pointer to a function - I had to cast everything explicitly (is there any way in C++ to declare a pointer to a general fn, rhater than specific types ?) However, all the solutions seem to rule out the possibility of using C header files within C++. This (at least for the time being when a lot of extremely useful software e.g. isode package is written in C) is crazy. G++ actually does the sensible (in my view anyway :-)) thing and I would use that in preference to AT&T anyday were it not for other software constraints. Alan Shepherd