This is the mail archive of the gcc-bugs@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: bug (or nuisance ?) in g++ 2.95.2


Kris Thielemans wrote:

> here is a test file:
> -------------
> extern "C" {
> f();
> }
> 
> void main()
> {}
> -------------
> wren->gcctest> g++ int.cxx
> int.cxx:2: ANSI C++ forbids declaration `f' with no type
> 
> I wonder if this is really in the ANSI C++ standard. Indeed, how can one
> expect that C header files are suddenly going to be updated ? I'd say that
> things within extern "C" {} should follow ANSI C syntax, not C++.
No. extern "C" {..} merely affects the linkage, it does not change the
language. You may disagree, but that's what the standard says.

nathan

-- 
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
Never hand someone a gun unless you are sure where they will point it
nathan@acm.org  http://www.cs.bris.ac.uk/~nathan/  nathan@cs.bris.ac.uk


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