Re: need help..
- From: Mark McIntyre <markmcintyre@xxxxxxxxxxx>
- Date: Sun, 03 Apr 2005 20:53:54 +0100
On Sat, 02 Apr 2005 17:00:06 -0500, in comp.lang.c , dot@xxxxxxx
wrote:
>On Sat, 02 Apr 2005 20:00:39 GMT, Keith Thompson <kst-u@xxxxxxx> wrote:
>
>>>>3) Quality compilers warn about the ``if (foo = 0)'' construct.
>>>
>>> It should be a syntax error.
>>
>>In a different language, sure. In C, an assignment is an expression
>>that yields the value assigned; changing that would break too much
>>existing code.
>
>If the compiler can detect it sufficiently to warn, it can hand out an
>error, stop compilation and force you to fix it.
point is, it might be able to warn you, but its a perfectly legal
construct, and one that many people use deliberately.
>Frankly, it would have made more sense to have the testing done on a single
>=, & or | marks and use the doubles for assignment along with >> and <<
>which are used for bit shifts.
If you have a time machine, pop back thirty odd years and mention that
to the designers of BCPL and B. Otherwise, you'll need to discuss it
in the context of a new language.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>
.
- References:
- need help..
- From: slickn_sly
- Re: need help..
- From: Martin Ambuhl
- Re: need help..
- From: CBFalconer
- Re: need help..
- From: Nils Weller
- Re: need help..
- From: Keith Thompson
- need help..
- Prev by Date: Re: Need HELP
- Next by Date: Re: need help..
- Previous by thread: Re: need help..
- Next by thread: Re: need help..
- Index(es):
Relevant Pages
|