public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: John Carter <john.carter@taitradio.com>
Cc: gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: Why is there now a difference between "{static const char a[]={...}" and "{const char a[]={...}"?
Date: Fri, 02 Nov 2018 11:12:00 -0000	[thread overview]
Message-ID: <CAH6eHdRi8a-b7MYz-8FEjSW8OC6ijWi9FJv1fbexEOjs=B0-mg@mail.gmail.com> (raw)
In-Reply-To: <CAFD1m3ELeJggm0LVhegaVAXpOGo1nvy8AK81Xq1BgPxdsiR5NA@mail.gmail.com>

On Tue, 30 Oct 2018 at 02:16, John Carter wrote:
>
> https://gcc.godbolt.org/z/6c4QLO
>
> Something changed between gcc 4.1 and 4.4

I think this changed with https://gcc.gnu.org/r143570 to fix
https://gcc.gnu.org/PR38615

See https://gcc.gnu.org/ml/gcc/2008-11/msg00201.html and
https://gcc.gnu.org/ml/gcc/2008-11/msg00202.html for a more complete
explanation of why the 4.1 behaviour is non-conforming and had to be
fixed.

If you use -fmerge-all-constants you get the old behaviour back, but
as noted in the manual that option makes the program non-confirming.
If your program doesn't rely on stack variables having distinct
addresses in recursive calls, you can probably use that option safely.

  reply	other threads:[~2018-11-02 11:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-30  2:15 John Carter
2018-11-02 11:12 ` Jonathan Wakely [this message]
2018-11-02 11:13   ` 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='CAH6eHdRi8a-b7MYz-8FEjSW8OC6ijWi9FJv1fbexEOjs=B0-mg@mail.gmail.com' \
    --to=jwakely.gcc@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=john.carter@taitradio.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).