[LAD] G++ trouble

Alexandre DENIS contact at alexandredenis.net
Mon Nov 16 10:37:46 CET 2020


On Mon, 16 Nov 2020 09:43:42 +0100
Fons Adriaensen <fons at linuxaudio.org> wrote:

> Hello all,
> 
> I'm having a strange problem with G++...
> 
> In one source file 'fb3data.cc', I define arrays like this:
> 
>     const float svcoeff44 [216] =
>     {
>          1.631996e-03, 6.335480e-02, ...
>          ...
>     };
> 
> (...)
> /usr/bin/ld: filtbank3.o: warning: relocation against `svcoeff88'
in
> read-only section `.text' 

Hi,

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.

-a.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.linuxaudio.org/archives/linux-audio-dev/attachments/20201116/6c4894d8/attachment.sig>


More information about the Linux-audio-dev mailing list