This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: bug (or nuisance ?) in g++ 2.95.2
- To: Kris Thielemans <k dot thielemans at ic dot ac dot uk>
- Subject: Re: bug (or nuisance ?) in g++ 2.95.2
- From: Nathan Sidwell <nathan at acm dot org>
- Date: Thu, 11 Nov 1999 17:38:46 +0000
- CC: gcc-bugs <gcc-bugs at gcc dot gnu dot org>
- References: <004a01bf2c66$ca16a030$1d4bb392@petnt1.rpms.ac.uk>
- Reply-To: nathan at compsci dot bristol dot ac dot uk
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