This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [gcc-in-cxx] Remove extern "C" from libdecnumber


Andrew Pinski <pinskia@gmail.com> writes:

> On Tue, May 26, 2009 at 9:16 PM, Ian Lance Taylor <iant@google.com> wrote:
>
>> 2009-05-26 ÂIan Lance Taylor Â<iant@google.com>
>>
>> Â Â Â Â* dfp.c: If __cplusplus, use extern "C" around inclusion of
>> Â Â Â Âlibdecnumber header files.
>
> That is bad coding style (most C++ text books recommend against doing
> that).  In fact it is one of the reasons why we should define a coding
> style right now for C++ usage in GCC.

I'm not sure that C++ coding style guidelines are wholly relevant when
working with a mixed language code base which combines code from
different sources.  I agree that it would be better to have the extern
"C" in the libdecnumber header files.  However, that code came from an
upstream source.  So the correct approach here is to convince the
upstream source to add the extern "C".  In the meantime, I think that
something like this patch is better than changing the libdecnumber
sources.  Would it make you happier if I moved the #include libdecnumber
statements into a header file in the gcc subdirectory?

Ian


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