Xref: news2.mv.net comp.os.msdos.djgpp:6855 gnu.gcc.help:7739 From: mac AT greatdane DOT webnexus DOT com (Mike McNamara) Newsgroups: gnu.gcc.help,comp.os.msdos.djgpp Subject: Re: array init warning Date: 06 Aug 1996 01:50:52 GMT Organization: WebNexus Communications Lines: 38 Message-ID: References: Reply-To: mac AT silicon-sorcery DOT com NNTP-Posting-Host: greatdane.webnexus.com In-reply-to: haack@hp403.den.mmc.com's message of 31 Jul 1996 08:53:07 -0600 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp In article haack AT hp403 DOT den DOT mmc DOT com (Brad R. Haack) writes: I'm using the djgpp port of gcc 2.7.2 on a pentium. Why does this style of initialization result in a warning (missing braces around initializer for`junk[0]') ? It seems like a reasonable and safe style to me. What flag would I use to turn this off? I'm using -Wall currently. int junk[2][3] = { 1, 2, 3, 4, 5, 6} ; A doubly dimensioned array requires a doubly depth initialization array: int junk[2][3] = { {1, 2, 3}, {4, 5, 6} }; This gives you other benies like: int junk[2][3] = { {1 }, {4, 5, 6}, {3, 2 }, } ; elided initializers defaluting to zero. besides, it's the standard! -mac -- Michael McNamara Silicon Sorcery Get my emacs mode (subscribe for free updates!) at