public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55227] New: designated initializer for char array by string constant
@ 2012-11-07  8:27 pavel.v.chupin at gmail dot com
  2012-11-07 22:25 ` [Bug c++/55227] " daniel.kruegler at googlemail dot com
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: pavel.v.chupin at gmail dot com @ 2012-11-07  8:27 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55227
           Summary: designated initializer for char array by string
                    constant
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: pavel.v.chupin@gmail.com


t.C:

struct S { char a[25]; };

int main() {
   struct S s = {a:"aaaa"};
   (void)s;
   return 0;
}


t.C: In function 'int main()':
t.C:4:26: error: C99 designator 'a' outside aggregate initializer
    struct S s = {a:"aaaa"};
                          ^
Workarounds:
1) struct S s = {"aaaa"};
2) struct S { char *a; };


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

end of thread, other threads:[~2022-01-23 22:27 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-07  8:27 [Bug c++/55227] New: designated initializer for char array by string constant pavel.v.chupin at gmail dot com
2012-11-07 22:25 ` [Bug c++/55227] " daniel.kruegler at googlemail dot com
2020-04-08 10:11 ` ensadc at mailnesia dot com
2020-06-16 11:40 ` steven.spark at gmail dot com
2021-10-24 15:54 ` wjwray at gmail dot com
2021-10-24 21:25 ` wjwray at gmail dot com
2021-10-24 21:31 ` wjwray at gmail dot com
2021-10-25 17:06 ` wjwray at gmail dot com
2021-10-25 17:44 ` wjwray at gmail dot com
2021-11-04 23:43 ` wjwray at gmail dot com
2021-11-07  0:27 ` pinskia at gcc dot gnu.org
2021-11-18  3:17 ` wjwray at gmail dot com
2021-11-18  3:21 ` wjwray at gmail dot com
2021-12-14  5:34 ` pinskia at gcc dot gnu.org
2022-01-23 22:27 ` cvs-commit at gcc dot gnu.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).