This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [C++] extern "C" typedefs


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]