This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: extern "C" applied liberally?
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Jay K <jay dot krell at cornell dot edu>
- Cc: gcc <gcc at gcc dot gnu dot org>
- Date: Tue, 16 Nov 2010 02:59:58 -0600
- Subject: Re: extern "C" applied liberally?
- References: <COL101-W63D4703F78392E4C4888F0E6370@phx.gbl>
On Mon, Nov 15, 2010 at 7:19 PM, Jay K <jay.krell@cornell.edu> wrote:
>
> I know it is debatable and I could be convinced otherwise, but I would suggest:
>
>
>
> #ifdef __cplusplus
> extern "C" {
> #endif
>
> ...
>
>
> #ifdef __cplusplus
> } /* extern "C" */
> #endif
>
>
> be applied liberally in gcc.
> Not "around" #includes, it is the job of each .h file, and mindful of #ifdefs (ie: correctly).
>
>
> Rationale:
> ?Any folks that get to see the mangled names, debugging, working on binutils, whatever, are saved from them.
> ? ? They are generally believed to be ugly, right? Yeah yeah, not a technical argument.
binutils are good at handling those stuff these days.
In long term, that change looks counter productive.
[...]
> I think it is a good idea for any C or historically C code when moving to a C++ compiler.
it may or may not be. In this case, I don't think it is.
The transition is complete now.
> They could/would be removed as templates/function overloads/operator overloading are introduced.
why introduce kludge that we may have to remove later, when the kludge
fixes no glaring problem?