Re: [LAD] G++ trouble

From: Uwe Koloska <lad@email-addr-hidden>
Date: Tue Nov 17 2020 - 00:24:35 EET

Am 16.11.20 um 10:37 schrieb Alexandre DENIS:
>
> I've already seen this strange behavior with gcc 9.x : symbols with
> a const definition are by default not publicly visible. It works
> if you explicitly add an "extern" in the definition:
>
> extern const float svcoeff44 [216] = (...)
>
> I am not sure whether it is a bug in gcc or a strict application of the
> standard.

It's standard behavior, but have only found it on
https://en.cppreference.com/w/cpp/language/cv#Notes

The const qualifier used on a declaration of a non-local non-volatile
non-template (since C++14) non-inline (since C++17) variable that is not
declared extern gives it internal linkage. This is different from C
where const file scope variables have external linkage.

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

This archive was generated by hypermail 2.1.8 : Tue Nov 17 2020 - 04:15:03 EET