delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/25/02:45:55

Date: Thu, 25 Dec 1997 09:44:17 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Noam Rotem <nrotem AT johnbryce DOT co DOT il>
cc: djgpp AT delorie DOT com
Subject: Re: The warning <-- Solved. Thank you
In-Reply-To: <Chameleon.971224184358.nrotem@netvision.netvision>
Message-ID: <Pine.SUN.3.91.971225094349.20294B-100000@is>
MIME-Version: 1.0

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?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019