public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/36446]  New: unexplained warning in struct initialization
@ 2008-06-05 21:59 geoffrey dot levand at am dot sony dot com
  2008-06-05 22:00 ` [Bug c/36446] " pinskia at gcc dot gnu dot org
  2008-06-05 22:02 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 8+ messages in thread
From: geoffrey dot levand at am dot sony dot com @ 2008-06-05 21:59 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 864 bytes --]

/*
  gcc -W -c test.c
  test.c:18: warning: (near initialization for ‘m1.h.b’)
*/

struct h {
        int a;
        int b;
};

struct m {
        struct h h;
        int c;
};

struct m m1 = {
        .h.a = 1,
        .c = 2,
};

struct m m2 = {
        .h = {.a = 1},
        .c = 2,
};

m1 has that warning, but m2 is ok.

I hit this with both these:
 gcc version 4.1.1
 gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)

-Geoff


-- 
           Summary: unexplained warning in struct initialization
           Product: gcc
           Version: 4.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: geoffrey dot levand at am dot sony dot com
  GCC host triplet: i386-redhat-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36446


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-06-09 20:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-36446-4@http.gcc.gnu.org/bugzilla/>
2012-04-18 12:58 ` [Bug c/36446] unexplained warning in struct initialization vadmium+gc at gmail dot com
2012-04-18 13:28 ` manu at gcc dot gnu.org
2012-04-18 13:40 ` manu at gcc dot gnu.org
2012-04-18 14:05 ` manu at gcc dot gnu.org
2014-06-09  9:41 ` mpolacek at gcc dot gnu.org
2014-06-09 20:37 ` mpolacek at gcc dot gnu.org
2008-06-05 21:59 [Bug c/36446] New: " geoffrey dot levand at am dot sony dot com
2008-06-05 22:00 ` [Bug c/36446] " pinskia at gcc dot gnu dot org
2008-06-05 22:02 ` pinskia at gcc dot gnu dot org

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).