This is the mail archive of the
mailing list for the GCC project.
Re: PATCH RFA: Remove extern "C" from java header file
On Wed, Jun 10, 2009 at 3:29 AM, Ian Lance Taylor<firstname.lastname@example.org> wrote:
> Andrew Pinski <email@example.com> writes:
>> On Tue, Jun 9, 2009 at 9:58 PM, Ian Lance Taylor<firstname.lastname@example.org> wrote:
>>> The java frontend header file java/verify.h has an extern "C" wrapper.
>>> This breaks when compiling java with C++. ?I can't think of any reason
>>> for having it. This patch removes it. ?Bootstrapped and tested on
>>> x86_64-unknown-linux-gnu. ?OK for mainline?
>> How does it break? ?The original code in verify.h came from the
>> runtime which was originally written in C++ so they wanted to provide
>> a C interface of the C++ code.
> It breaks because the extern "C" is used around the gcc header files
> such as system.h, coretypes.h, etc. ?When gcc is compiled with C++,
> those header files declare C++ functions, not C functions. ?Thus there
> is confusion as to what the functions should be named.
I think this is just a hangover from when the verifier was originally
ported from the C++ version in the runtime. I can't think of a reason
to have it - the verifier implementation is not actually shared
between the front end and the runtime, so it can be removed.