www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/29/13:52:11

Date: Mon, 29 Dec 97 20:39:15 PST
From: Noam Rotem <nrotem AT johnbryce DOT co DOT il>
Subject: Re: The warning <-- Solved. Thank you
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Cc: djgpp AT delorie DOT com
Message-ID: <Chameleon.971229204813.nrotem@netvision.netvision>
MIME-Version: 1.0

--- On Mon, 29 Dec 1997 10:17:17 +0200 (IST)  Eli Zaretskii 
<eliz AT is DOT elta DOT co DOT il> wrote:

>
>On Sun, 28 Dec 1997, Noam Rotem wrote:
>
>> Warning:  excess elements in array initializer after 
`Mat[0]'
>> 
>> My question is - why do Borland compilers treat this wrong 
syntax as an 
>> error, while dgjpp only warns against it?
>
>A warning means that DJGPP is not sure that the code is 
wrong, and
>assumes that you might know what you are doing.  I don't see 
anything
>wrong with this approach; you should always treat the 
warnings
>seriously and examine each of them carefully.

I agree with you completely (and apologize for this long long 
responsa, but I might be missing something in this whole 
topic), but is there ANY possibility that someone will write 
this wrong code deliberately? If so, it should be a legal 
syntax, accompanied with a general warning for those who 
wrote it by mistake. But, if it is NEVER a correct syntax, 
and in no case it should be written, then let it be an error. 
Am I missing something?

I'm referring, by the way, to the following code:

int A[4][2]={{1,2,3,4},{5,6,7,8}};

---------------------------------------------
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.

---
29/12/97
20:39:15

- Raw text -


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