Mail Archives: djgpp/1996/08/07/08:49:11
In article <xbubugwfp9o DOT fsf AT hp403 DOT den DOT mmc DOT com> 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 <http://www.silicon-sorcery.com>
Get my emacs mode (subscribe for free updates!) at
<http://www.silicon-sorcery.com/verilog-mode.html>
- Raw text -