This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: [C++] extern "C" typedefs
- To: nathan at codesourcery dot com
- Subject: Re: [C++] extern "C" typedefs
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Tue, 23 May 2000 09:14:50 -0700
- Cc: gcc-bugs at gcc dot gnu dot org
- Organization: CodeSourcery, LLC
- References: <3929A177.B620173C@codesourcery.com>
>>>>> "Nathan" == Nathan Sidwell <nathan@codesourcery.com> writes:
Nathan> The problem is that, unless -pedantic is given, a typedef
Nathan> of the form typedef void (*fptr) (); is treated as typedef
Nathan> void (*fptr) (...); rather than typedef void (*fptr)
Nathan> (void); [this extension is not documented in extend.texi]
I think this should extension should be removed, by default. It's
simply too hard to maintain. Correct operation would require tagging
the types in some way, and then adjusting the type-conversion code to
treat the type as `void (*)()' *unless* that didn't work and then do
`void (*)(...)'.
As a point of reference, the EDG front-end does not implicitly add an
ellipsis inside `extern "C"'.
One reasonable option would be to only add the `...' with
-fpermissive. I think that's what we should do.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com