Mail Archives: djgpp/1996/11/22/03:21:10
A.Appleyard wrote:
>
> Please reply to me also in person, as I had to unsubscribe from djgpp email
> group due to email intray overload. I am sorry to keep troubling you.
>
> (0) About how many messages are there per day now on djgpp email group?
It's around 40-50 nowadays, but as Eli suggested you can simply read the
newsgroup. ;)
> I have just had my first go with v2, which I downloaded from Hensa at
> Lancaster (England) today. I have a big program (a text editor), which v1 has
> compiled many times under -Wall without complaint, but under v2 with -Wall:-
v1 and v2 are substantially different compilers. I suggest seriously
that you read the v2 FAQ (v2/faq202b.zip) for information on all the
changes.
> (2) Can this warning be suppressed specifically, similarly?:-
> `warning: suggest parentheses around assignment used as truth value'
No! It is a very bad idea to suppress this sort of warning. The
precedence of the '=' and '==' operators can be very confusing, and if
you do it wrong you'll get undesired results. For example:
if ( x = y == z )
...
In this expression, (y == z) is evaluated first, and the value of that
expression is assigned to x. If this is truly what you intended, then
you should explicitly put parentheses around the (y == z). If not, then
this is a serious bug in your program, and should be replaced by:
if ( ( x = y ) == z )
...
That warning is there because the compiler is unable to distinguish
between correct and incorrect applications of these operators. Eli
suggested a method to use, but you should only use it if you KNOW that
all your truth expressions are correct!
--
John M. Aldrich, aka Fighteer I <fighteer AT cs DOT com>
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS d- s+:- a-->? c++>$ U@>++$ p>+ L>++ E>+ W++ N++ o+ K? w(---) O-
M-- V? PS+ PE Y+ PGP- t+(-) 5- X- R+ tv+() b+++ DI++ D++ G e(*)>++++
h!() !r !y+()
------END GEEK CODE BLOCK------
- Raw text -