[hipl-dev] Re: [Merge] lp:~stefan.goetz/hipl/fw-cache-port-cleanup into lp:hipl

  • From: Diego Biurrun <diego@xxxxxxxxxx>
  • To: hipl-dev@xxxxxxxxxxxxx
  • Date: Tue, 02 Nov 2010 12:17:21 +0100

On Mon, Nov 01, 2010 at 11:06:47AM +0000, Stefan Götz wrote:
> > > > > +#ifdef __cplusplus
> > > > > +}
> > > > > +#endif
> > 
> > Seriously, if you want to use a C library from C++ (not the case here
> > anyway), keep the workarounds where they belong and don't clutter the
> > lib with it.
>
> Unhappy as I am to spend more precious bits on this dubious topic,
> which the facts of written and commited code scripture have already
> obsoleted, the interesting and peculiar case of the exotic extern "C"
> warrants two remarks with regard to your esteemed general statement:
>
> 1) some people would argue that extern "C" is a feature, not a
> workaround. Other people strongly disagree. It's a shady lane with
> several reported cases of back-stabbings among language lawyers.
>
> 2) extern "C" is present in all system and many popular library header
> files (possibly because otherwise every C++ source file including one
> of them would need such an extern "C" statement).

The world is not a GNU.

> My point being: people who got lucky in the IQ lottery, such as Ulrich
> Drepper, have thought about this issue. Their solution is to put
> extern "C" in the header rather than the source file. If they do it
> over and over, it can't be all that horrible of a no-go.

Ulrich Drepper and his glibc monster are not a good example.
One of my favorite .sigs about the topic:

  _______________________________________________ 
  I hate to see young programmers poisoned by the kind of thinking
  Ulrich Drepper puts forward since it is simply too narrow -- Roman Shaposhnik
  _______________________________________________ 

:)

Diego

Other related posts: