This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/76732] New: GCC should warn on repeated initializer for same array element / struct member.


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

            Bug ID: 76732
           Summary: GCC should warn on repeated initializer for same array
                    element / struct member.
           Product: gcc
           Version: 5.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rusty at rustcorp dot com.au
  Target Milestone: ---

Hit a nasty cut & paste bug in my code (extra comma before +3):

   int x[] = { [0] = 1, +3, [1] = 1 };

This double-initialization of x[1] should cause a warning.  Similarly:

   struct s { int a, b; } s = { .a = 1, .a = 2};

Thanks!

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 76733 has been marked as a duplicate of this bug. ***

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]