public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "joseph at codesourcery dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/64918] invalid (?) warning when initializing structure
Date: Tue, 03 Feb 2015 15:47:00 -0000	[thread overview]
Message-ID: <bug-64918-4-AMfExptPh7@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-64918-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64918

--- Comment #1 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
I think the logical side-effect in C standard terms of the initializer 
being overridden is that it contains a compound literal, and so executing 
that initializer has the side-effect of initializing that compound literal 
(compound literal initializers being executed each time the compound 
literal is reached in the order of execution).  The warning is because 
it's unspecified whether overridden initializers are executed at all, and 
so whether their side-effects occur - but in this case it's maybe not so 
helpful, because the compound literal in the overridden initializer can't 
actually be accessed so it doesn't matter if the side-effect of 
initializing it gets lost (unless any of its initializers contained other 
side-effects, which they don't in this case).


  reply	other threads:[~2015-02-03 15:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-03 13:43 [Bug c/64918] New: " oystein at gnubg dot org
2015-02-03 15:47 ` joseph at codesourcery dot com [this message]
2015-02-03 16:38 ` [Bug c/64918] " oystein at gnubg dot org
2015-02-03 17:33 ` joseph at codesourcery dot com
2015-04-20 15:14 ` mpolacek at gcc dot gnu.org
2015-04-23 22:44 ` mpolacek at gcc dot gnu.org
2015-04-23 23:33 ` manu at gcc dot gnu.org
2015-05-07 22:15 ` mpolacek at gcc dot gnu.org
2021-01-05 16:57 ` mpolacek at gcc dot gnu.org

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=bug-64918-4-AMfExptPh7@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).