Mail Archives: djgpp/1997/12/23/10:24:41
On Tue, 23 Dec 1997 13:52:44 GMT gregorio AT jet DOT es (Grzegorz Adam Hankiewicz)
wrote:
> Hello.
>
> For some time i've compiled my programs without warning flags.
> Now I compile with -Werror -Wall -W.
>
> The point is that I can't recompile some old source. There, I make the
> following definition/declaration/whateverisitsname :
>
> char line[4][2] = {2,1,2,1,
> 3,4,2,1};
>
> The compiler points me to that line and says:
>
> l.c(5) Warning: missing braces around initializer for `line[0]'
>
> I guess you can figure out my question. How do I avoid these 'missing
> braces' warnings?
You declared 2D array and compiler waits to appropriate form of data but
gets data for linear array. Solution: use right form of data
char line[4][2] = {{2,1},{2,1},{3,4},{2,1}};
BTW, this question is not directly connected with DJGPP but with
general C language programing.
Alexander Bokovoy, <bokovoy AT bspu DOT ac DOT by>
---== The Soft Age coming soon ==---
- Raw text -