[nem-en] incorrect side effect of ++ operator

Michal Moskal malekith at pld-linux.org
Mon Sep 27 15:47:56 CEST 2004


On Mon, Sep 27, 2004 at 03:34:48PM +0200, Marcin 'Qrczak' Kowalczyk wrote:
> Michal Moskal <malekith at pld-linux.org> writes:
> 
> > Now, when the warning is optional, we can make ++ return value, there
> > is no problem with that. We could even make = return value, but I would
> > rather avoid this one (if (x = true) ... vs if (x == true) ...).
> 
> What about the typing of
> 
>    if cond then
>       ++i
>    else
>       something-of-type-void
> 
> ?

It would be :void (with warning, if enabled).

-- 
: Michal Moskal :: http://www.kernel.pl/~malekith :: GCS !tv h e>+++ b++
: ::: Logic is a nice contrast to the Real World. :: UL++++$ C++ E--- a?




More information about the devel-en mailing list