[C++] extern "C" typedefs

Mark Mitchell mark@codesourcery.com
Tue May 23 09:06:00 GMT 2000


>>>>> "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


More information about the Gcc-bugs mailing list