This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/4754: problem with nested extern "C"
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/4754: problem with nested extern "C"
- From: markus at heichel dot org
- Date: 31 Oct 2001 13:36:15 -0000
- Reply-To: markus at heichel dot org
>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()
{
}