Re: [LAD] G++ trouble

From: Uwe Koloska <lad@email-addr-hidden>
Date: Tue Nov 17 2020 - 18:51:20 EET

Am 17.11.20 um 10:59 schrieb Fons Adriaensen:
> But it doesn't make sense to me.

Yes, we are in the same boat here.

> I've always understood 'extern' has
> 'defined somewhere but not here'. In other words 'extern' must be
> part of a declaration, and not of a definition as that would be
> a contradiction in terms.

I finally have found something in the C++11 standard. But only in
appendix C that lists the differences to ISO C. There is a rationale,
but I don't get why this is more important than consistency ...

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf

 * Change :: A name of file scope that is explicitly declared =const=,
   and not explicitly declared =extern=, has internal linkage, while in
   C it would have external linkage
 * Rationale :: Because =const= objects can be used as compile-time
   values in C++, this feature urges programmers to provide explicit
   initializer values for each =const=. This feature allows the user to
   put =const= objects in header files that are included in many
   compilation units.
 * Effect on original feature :: Change to semantics of well-defined
   feature.
 * Difficulty of converting :: Semantic transformation
 * How widely used :: Seldom

Uwe
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
https://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Wed Nov 18 04:15:02 2020

This archive was generated by hypermail 2.1.8 : Wed Nov 18 2020 - 04:15:02 EET