Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 May 2010 23:36:15 +0300
From:      Eitan Adler <lists@eitanadler.com>
To:        Max Laier <max@love2party.net>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: proposed change to style(9): require yoda style if statements
Message-ID:  <AANLkTina6dN7kKJwDJLHW9m7oOC12kfBV8Ge4NJaIGb7@mail.gmail.com>
In-Reply-To: <201005112233.24473.max@love2party.net>
References:  <AANLkTimCLELSQ9YNZ403_PLhKOQCQTcl9H1bfb1ccRNb@mail.gmail.com>  <201005112233.24473.max@love2party.net>

next in thread | previous in thread | raw e-mail | index | archive | help
> With proper -W flags, "if (var =3D const)" also yields a warning:
>
> =C2=A0warning: suggest parentheses around assignment used as truth value
>
> Chaning style(9) in such a fundamental way almost, always isn't a good id=
ea.
> It's simply unrealistic to change all current code to comply and the
> difference between old and new code will just add to the confusion.

Per Julian Elischer
We might suggest it rather than mandate it.
Also this method is compiler agnostic and generates a stronger warning
(an error rather than a warning)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTina6dN7kKJwDJLHW9m7oOC12kfBV8Ge4NJaIGb7>