On 25 January 2018 at 12:29, Jonathan Wakely wrote:
> On 25 January 2018 at 12:27, Georg-Johann Lay wrote:
>> On 22.01.2018 16:20, Jonathan Wakely wrote:
>>>
>>> On 21 January 2018 at 12:08, Georg-Johann Lay wrote:
Jay K schrieb:
>
>
> extern const int foo = 123;
>
> W
On 25 January 2018 at 12:27, Georg-Johann Lay wrote:
> On 22.01.2018 16:20, Jonathan Wakely wrote:
>>
>> On 21 January 2018 at 12:08, Georg-Johann Lay wrote:
>>>
>>> Jay K schrieb:
extern const int foo = 123;
Why does this warn?
This is a valid portable form, with the
On 22.01.2018 16:20, Jonathan Wakely wrote:
On 21 January 2018 at 12:08, Georg-Johann Lay wrote:
Jay K schrieb:
extern const int foo = 123;
Why does this warn?
This is a valid portable form, with the same meaning
across all compilers, and, importantly, portably
to C and C++.
I also wondered
On 2018-01-22 10:53:55 +0100, David Brown wrote:
> On 22/01/2018 10:31, Jay K wrote:
> >
> > By this argument there is a missing warning for the equivalent:
> >
> > const int foo = 123;
> >
> > with no previous extern declaration.
>
> I would like to see such a warning. There is "-Wmissing-
On 21 January 2018 at 12:08, Georg-Johann Lay wrote:
> Jay K schrieb:
>>
>> extern const int foo = 123;
>>
>> Why does this warn?
>> This is a valid portable form, with the same meaning
>> across all compilers, and, importantly, portably
>> to C and C++.
>
>
> I also wondered about this.
>
> In C99
On 21 January 2018 at 07:12, Jay K wrote:
> extern const int foo = 123;
>
>
>
> Why does this warn?
> This is a valid portable form, with the same meaning
> across all compilers, and, importantly, portably
> to C and C++.
>
> I explicitly do not want to say:
>
> const int foo = 123
>
> because I
- Jay
--------
*From:* David Brown
*Sent:* Monday, January 22, 2018 10:42 AM
*To:* Jay K; gcc
*Subject:* Re: extern const initialized warns in C
On 22/01/2018 11:14, Jay K wrote:
I meant:
extern const foo = 123;
does not war
exported if they are annotated
in source or listed in a separate file. Not just by being non-static.
- Jay
From: David Brown
Sent: Monday, January 22, 2018 10:42 AM
To: Jay K; gcc
Subject: Re: extern const initialized warns in C
On 22/01/2018 11:14, Ja
level static.
There are no /good/ arguments against file-level static in C, except
perhaps temporarily while debugging (it can be easier to view non-static
data in a debugger). Any time file-level static can be used, it
/should/ be used.
IMHO, of course.
mvh.,
David
- Jay
From: David B
___
From: David Brown
Sent: Monday, January 22, 2018 10:14 AM
To: Jay K; gcc
Subject: Re: extern const initialized warns in C
Hi,
I made some points in my other reply. But for completeness, I'll tackle
these too.
On 22/01/2018 10:38, Jay K wrote:
> Also the warning did not i
e, I can afford a rename to do it.
I am not sure what you mean by that.
mvh.,
David
- Jay
From: Jay K
Sent: Monday, January 22, 2018 9:31 AM
To: David Brown; gcc
Subject: Re: extern const initialized warns in C
By this argument there is a missing warning for the equivale
er). Any time file-level static can be used, it
/should/ be used.
IMHO, of course.
mvh.,
David
- Jay
From: David Brown
Sent: Monday, January 22, 2018 8:32 AM
To: Jay K; gcc
Subject: Re: extern const initialized warns in C
On 21/01/18 08:12, Jay K wrote:
extern const int foo = 1
Am 2018-01-21 um 13:08 schrieb Georg-Johann Lay:
Jay K schrieb:
extern const int foo = 123;
Why does this warn?
This is a valid portable form, with the same meaning
across all compilers, and, importantly, portably
to C and C++.
I also wondered about this.
In C99 §6.9.2 "External object defin
and if I need to make
the symbol extern in future, I can afford a rename to do it.
- Jay
From: Jay K
Sent: Monday, January 22, 2018 9:31 AM
To: David Brown; gcc
Subject: Re: extern const initialized warns in C
By this argument there is a missing warning for the equivalent:
con
e are many arguments for and against file level static.
- Jay
From: David Brown
Sent: Monday, January 22, 2018 8:32 AM
To: Jay K; gcc
Subject: Re: extern const initialized warns in C
On 21/01/18 08:12, Jay K wrote:
> extern const int foo = 123;
>
>
>
> Why does this warn?
&
On 21/01/18 08:12, Jay K wrote:
> extern const int foo = 123;
>
>
>
> Why does this warn?
> This is a valid portable form, with the same meaning
> across all compilers, and, importantly, portably
> to C and C++.
>
> I explicitly do not want to say:
>
> const int foo = 123
>
> because I want
Jay K schrieb:
extern const int foo = 123;
Why does this warn?
This is a valid portable form, with the same meaning
across all compilers, and, importantly, portably
to C and C++.
I also wondered about this.
In C99 §6.9.2 "External object definitions" there's actually
the following example in
17 matches
Mail list logo