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
On Mon, 16 Nov 2020 16:31:18 +0100
Fons Adriaensen wrote:
>or
>
>* Just #define it in a header (e.g. globals.h) instead of creating
> a variable.
>
>
>Ciao,
>
Thanks again. I've gone for this options. It keeps these together, along with a
bunch of enums so they're easy to find.
--
It
On Mon, Nov 16, 2020 at 01:38:01PM +, Will J Godfrey wrote:
> I just did a search of the whole of src. It's *used* about a dozen times
> across 5 otherwise unrelated .cpp files, but is only defined here. Just to be
> certain, I did a make clean before trying this again, and it's definitely
On Mon, 16 Nov 2020 14:52:53 +0100
Alexandre DENIS wrote:
>On Mon, 16 Nov 2020 13:38:01 +
>Will J Godfrey wrote:
>
>> Not wishing to hijack this thread but I'm still confused :(
>>
>> I just did a search of the whole of src. It's *used* about a dozen
>> times across 5 otherwise unrelated
On Mon, 16 Nov 2020 13:38:01 +
Will J Godfrey wrote:
> Not wishing to hijack this thread but I'm still confused :(
>
> I just did a search of the whole of src. It's *used* about a dozen
> times across 5 otherwise unrelated .cpp files, but is only defined
> here. Just to be certain, I did a
On Mon, 16 Nov 2020 13:35:30 +0100
Fons Adriaensen wrote:
>On Mon, Nov 16, 2020 at 12:22:54PM +, Will J Godfrey wrote:
>
>> In GCC 8.3 doing that in a globally included header actually *creates* a
>> multiple definitions error!
>>
>> #ifndef GLOBALS_H
>> #define GLOBALS_H
>>
>> const
On Mon, Nov 16, 2020 at 12:22:54PM +, Will J Godfrey wrote:
> In GCC 8.3 doing that in a globally included header actually *creates* a
> multiple definitions error!
>
> #ifndef GLOBALS_H
> #define GLOBALS_H
>
> const unsigned int ADD_COLOUR = 0xdfafbf00; fine
Putting a definition in a
On Mon, 16 Nov 2020 13:02:03 +0100
Fons Adriaensen wrote:
>On Mon, Nov 16, 2020 at 12:24:10PM +0100, Kjetil Matheussen wrote:
>
>> A common mistake in C is omitting extern when declaring a global
>> variable in a header file. If the header is included by several files
>> it results in multiple
On Mon, Nov 16, 2020 at 12:59 PM Roman Sommer wrote:
>
> Kjetil Matheussen writes:
> >
> > Yeah, I just read this: https://gcc.gnu.org/gcc-10/porting_to.html
> >
> > "
> >
> > C language issues
> >
> > Default to -fno-common
> >
> > A common mistake in C is omitting extern when declaring a
On Mon, Nov 16, 2020 at 12:24:10PM +0100, Kjetil Matheussen wrote:
> A common mistake in C is omitting extern when declaring a global
> variable in a header file. If the header is included by several files
> it results in multiple definitions of the same variable.
But
* I _do_ have 'extern' in
Alexandre DENIS:
> On Mon, 16 Nov 2020 09:43:42 +0100
> Fons Adriaensen 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,
On Mon, 16 Nov 2020 09:43:42 +0100
Fons Adriaensen 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, ...
> ...
> };
Hello again,
This is the correct version:
(I typed this in manually instead of copy/paste...)
const float *c;
switch (fsam)
{
case 44100:
c = svcoeff44;
break;
case 48000:
c = svcoeff48;
break;
...
}
Ciao,
--
FA
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, ...
...
};
There are five of these. In 'fbdata3.h' I have
extern const float svcoeff44
14 matches
Mail list logo