public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "robert.dumitru at cyberthorstudios dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/82283] Wrong warning with -Wmissing-field-initializers Date: Wed, 14 Apr 2021 09:39:58 +0000 [thread overview] Message-ID: <bug-82283-4-mdrx3T3pvI@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-82283-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82283 Robert Dumitru <robert.dumitru at cyberthorstudios dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |robert.dumitru@cyberthorstu | |dios.com --- Comment #10 from Robert Dumitru <robert.dumitru at cyberthorstudios dot com> --- We are experiencing the same issue: The warning: missing initializer for field ... [-Wmissing-field-initializers] is being thrown incorrectly. The following code is correct, however [-Wmissing-field-initializers] are shown. struct test_t{ int value1; int value2; }; struct test_t test[] = { [0].value1 = 1, [0].value2 = 2, [1].value1 = 10, [1].value2 = 20 }; int main(){ return 0; } warning: missing initializer for field 'value2' of 'struct test_t' [-Wmissing-field-initializers] [0].value2 = 2, warning: missing initializer for field 'value2' of 'struct test_t' [-Wmissing-field-initializers] [1].value2 = 20 The initialization is correct: _test: .long 1 .long 2 .long 10 .long 20 This bug was discovered first on version 8.3 but it can be reproduced on version 10.2 as well. Please note you need the -Wextra flag in order to reproduce this. I think https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99081 is also relating to this.
next prev parent reply other threads:[~2021-04-14 9:39 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-82283-4@http.gcc.gnu.org/bugzilla/> 2020-05-12 19:53 ` marxin at gcc dot gnu.org 2021-04-14 9:39 ` robert.dumitru at cyberthorstudios dot com [this message] 2021-04-14 9:56 ` redi at gcc dot gnu.org 2022-02-04 8:28 ` rsandifo at gcc dot gnu.org 2022-03-22 18:36 ` mpolacek at gcc dot gnu.org 2022-03-22 20:41 ` cvs-commit at gcc dot gnu.org 2022-03-22 20:43 ` mpolacek at gcc dot gnu.org 2022-03-24 9:26 ` yann at droneaud dot fr 2022-03-29 1:46 ` cvs-commit at gcc dot gnu.org 2022-03-29 1:49 ` 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-82283-4-mdrx3T3pvI@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: linkBe 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).