Boolean Operators Slighted in C

Mike Wexler mike at peregrine.UUCP
Wed May 28 08:19:47 AEST 1986


In article <822 at brl-smoke.ARPA> rbj at icst-cmr (Root Boy Jim) writes:
>	Boolean quantities form an important abstract data type distinct from
>	counters, sets, real numbers, etc.  By not making the distinction,
>	the language encourages usage errors, the most notorious being
>		if ( a = b )
>			stuff;
>
>True. It is easily found tho.
             ------
How do I easily find these?
Given the following pseudocode fragment
	 int xyz(parameter1,parameter2)
	{
	...
		if (big_expression_1=big_expression_2) statement;
	...
	}
Where the "=" should be a "==" and the function is producing unexpected
results how would you easily track down this failure.  By easily I mean
more easily than compiling the program and noticing the error about using
an arithmetic expression where a boolean one was supposed to be.  If this
isn't what you meant by easily, what did you mean?
-- 
Mike Wexler
Email address:(trwrb|scgvaxd)!felix!peregrine!mike
Tel Co. address: (714)855-3923
;-) Internet address: ucivax at ucbvax.BERKELY.EDU!ucivax%felix!mike at peregrine :-(



More information about the Comp.lang.c mailing list