From mboxrd@z Thu Jan 1 00:00:00 1970 From: markus@heichel.org To: gcc-gnats@gcc.gnu.org Subject: c++/4754: problem with nested extern "C" Date: Wed, 31 Oct 2001 05:46:00 -0000 Message-id: <20011031133615.13158.qmail@sourceware.cygnus.com> X-SW-Source: 2001-10/msg00712.html List-Id: >Number: 4754 >Category: c++ >Synopsis: problem with nested extern "C" >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Wed Oct 31 05:46:02 PST 2001 >Closed-Date: >Last-Modified: >Originator: Markus Heichel >Release: 3.0.2 >Organization: >Environment: System: Linux wave 2.4.13 #1 SMP Thu Oct 25 14:26:17 CEST 2001 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: configure --enable-shared --enable-threads --enable-languages=c++ >Description: compiling the attached example gives an error: > c++ extern.cc extern.cc:5: storage class specified for field `i' Exit 1 >How-To-Repeat: c++ extern.cc >Fix: omit the second 'extern "C"' or use brackets around the definition of 'struct Test' >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="extern.cc" Content-Disposition: inline; filename="extern.cc" extern "C" { extern "C" struct Test { int i; }; } int main() { }