delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/01/09/13:32:13

Message-ID: <3697A081.AF8E9AD1@montana.com>
Date: Sat, 09 Jan 1999 11:31:29 -0700
From: bowman <bowman AT montana DOT com>
X-Mailer: Mozilla 4.5 [en] (Win95; I)
X-Accept-Language: en
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: Warning wanted
References: <004e01be3b94$fd372200$d3f8c6c3 AT johans-dator>
Reply-To: djgpp AT delorie DOT com


Johan Henriksson wrote:
> 
> It took me 2 hours to fix this problem! Can't you guys implement a
> warningsignal when this kind of declarations are done? A pitfall less for us
> Basicprogrammers :)

If you compile with the -Wall switch, it will report 'warning: left-hand
operand of comma expression has no effect' for int array[10,10].

If you review the gcc documentation, there are a number of warnings that
may be enabled on the command line. If you are moving to C from BASIC,
I'd urge you to at least always use -Wall, and to investigate and
understand every warning it throws. Some may seem a little cryptic, as
in the above, but the compiler is cautioning you that you are using C in
a way that, while not exactly incorrect, is probably not what you
intended.

- Raw text -


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