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 definitions" there's actually
the following example in clause 4:

extern int i3 = 3; // definition, external linkage

See https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01848.html for a patch to make it controllable, though I wrote it for the opposite reason, namely to be able to turn it into an error separately (and to sync with the clang option).

Franz

Reply via email to