Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!EROS.BERKELEY.EDU!whitcomb From: whitcomb@EROS.BERKELEY.EDU (Gregg Whitcomb) Newsgroups: gnu.g++.bug Subject: extern "C" bug Message-ID: <8905191656.AA23244@eros.berkeley.edu> Date: 19 May 89 16:56:15 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 51 version: g++ 1.35.0 config: vax (ultrix 3.0) problem: warning message "empty declaration" for structures declared after a typedef. Works okay if the typedef is moved after the struct declaration. Both test.cc and test.c run correctly regardless of the error. --------------------------------------- /* test.h */ typedef struct a A; struct a { int x; int y; int z; }; /* test.cc (warning message when compiled) */ #include extern "C" { #include "test.h" } main() { struct a s; s.x = 1; cout << s.x << "\n"; } /* test.c (works fine) */ #include #include "test.h" main() { struct a s; s.x = 1; printf("%d\n",s.x); } --------------------------------------- -Gregg Whitcomb whitcomb@ic.berkeley.edu