Date: Fri, 26 Dec 97 13:25:10 PST From: Noam Rotem Subject: Re: The warning <-- Solved. Thank you To: Eli Zaretskii Cc: djgpp AT delorie DOT com Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Precedence: bulk --- On Thu, 25 Dec 1997 09:44:17 +0200 (IST) Eli Zaretskii wrote: > >On Wed, 24 Dec 1997, Noam Rotem wrote: > >> >> char line[4][2] = { >> >> {2,1,2,1}, >> >> {3,4,2,1} >> >> }; >> > >> >I don't think this is the correct initialization. The >> correct one should >> >include 4 arrays of 2 numbers, not 2 arrays of 4. >> >> It's wrong, and the compiler shouldn't compile it. >> Initializing a row of 2 values with 4 values is an error of >> syntax.. >> >> Is there any methodic reason for ignoring this error, or is >> it a bug of the compiler? > >What bug? The above code *is* wrong, and the compiler rightfully >complains about it. The code below is the right one, and the compiler >compiles it without any warnings (I've just tried): > > char line[4][2] = { {2,1}, {2,1}, {3,4}, {2,1} }; > >So what error do you want to ignore, and why do you think the compiler >might have a bug here? I tested the *wrong* code on my djgpp, and it *did not* complain - not even a warning... This is what my question referred to as a potential bug. --------------------------------------------- Noam Rotem John Bryce Training Centre Tel Aviv, Israel. 03-7535803 ============================================= 1. Take upon yourself an impossible mission. 2. Accomplish the mission. 3. Go back to step 1. It's the only sane answer to modern life. --- 26/12/97 13:25:10