From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30238 invoked by alias); 2 Nov 2018 11:13:19 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 30216 invoked by uid 89); 2 Nov 2018 11:13:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:924 X-HELO: mail-it1-f180.google.com Received: from mail-it1-f180.google.com (HELO mail-it1-f180.google.com) (209.85.166.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Nov 2018 11:13:16 +0000 Received: by mail-it1-f180.google.com with SMTP id p64-v6so2686381itp.0 for ; Fri, 02 Nov 2018 04:13:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DGHJxn865Kznas/TRFooeFlES+sH+eBPiYZYaYCKo0Q=; b=jb3LuXKq78mo7Mmk3djkjfWLVMcY2v4IKdmMCZxwmmL4C/HgIYdVsZT/f2r1gWiwHA KgmzFbEzxiXopiBemsw0SmqgvbwCRTTaLV0TB8s67WWQF1pq/CDISxHA/Ghfu4VLQ6B7 FcksQCdmS4yUx9JPRlmVkZzIJIO1Ui3k/3KFWrHaa8Dsr7V/fc68N+NfmyWxMoejZQ7g bL1Hxtd9jbFWItnvLynxOGc6/EBMzB5o5RbqPNlp5MR8LyiQsAFnUqJ7LTIJw0j8Hepa RtMcMYGGIxZhRJVzq9dSIO5Q0k8gLwEauGYnR8dgVm4JNV4J3pOB5/fg1eQjnOhlO7Op lAEQ== MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Fri, 02 Nov 2018 11:13:00 -0000 Message-ID: Subject: Re: Why is there now a difference between "{static const char a[]={...}" and "{const char a[]={...}"? To: John Carter Cc: gcc-help Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-11/txt/msg00006.txt.bz2 On Fri, 2 Nov 2018 at 11:11, Jonathan Wakely wrote: > > 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. s/non-confirming/non-conforming/ > If your program doesn't rely on stack variables having distinct > addresses in recursive calls, you can probably use that option safely.