From: Georg-Johann Lay <avr@gjlay.de>
To: Jay K <jayk123@hotmail.com>
Cc: gcc <gcc@gcc.gnu.org>
Subject: Re: extern const initialized warns in C
Date: Sun, 21 Jan 2018 12:08:00 -0000 [thread overview]
Message-ID: <5A6482A4.7070901@gjlay.de> (raw)
In-Reply-To: <MWHPR18MB121457D8901E94B1F0F339D6E6ED0@MWHPR18MB1214.namprd18.prod.outlook.com>
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
Johann
next prev parent reply other threads:[~2018-01-21 12:08 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <MWHPR18MB121493D9F2292547E0AF6C3AE6ED0@MWHPR18MB1214.namprd18.prod.outlook.com>
2018-01-21 7:12 ` Jay K
2018-01-21 12:08 ` Georg-Johann Lay [this message]
2018-01-22 9:44 ` Franz Sirl
2018-01-22 15:20 ` Jonathan Wakely
2018-01-25 12:27 ` Georg-Johann Lay
2018-01-25 12:29 ` Jonathan Wakely
2018-01-25 12:30 ` Jonathan Wakely
2018-01-22 8:32 ` David Brown
2018-01-22 9:32 ` Jay K
2018-01-22 9:39 ` Jay K
2018-01-22 10:14 ` David Brown
2018-01-22 10:25 ` Jay K
2018-01-22 9:54 ` David Brown
[not found] ` <MWHPR18MB12145B5B3E0B093993C2D214E6EC0@MWHPR18MB1214.namprd18.prod.outlook.com>
2018-01-22 10:42 ` David Brown
2018-01-22 11:27 ` Jay K
2018-01-22 13:02 ` David Brown
2018-01-22 16:22 ` Vincent Lefevre
2018-01-22 15:19 ` Jonathan Wakely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5A6482A4.7070901@gjlay.de \
--to=avr@gjlay.de \
--cc=gcc@gcc.gnu.org \
--cc=jayk123@hotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).