Hi,
On Tue, Feb 09, 2016 at 05:46:21PM +0100, Steffan Karger wrote:
> gcc 5.2.1:
> $ clang -o no-yoda no-yoda.c
> no-yoda.c:5:9: warning: using the result of an assignment as a condition
> without
> parentheses [-Wparentheses]
> if (a = NULL) {
> ~~^~~~~~
I noticed this as well, and find it really useful (without needing -Wall).
> So, I do not have any strong preference.
In that case, my preference always is "match existing coding style"
(which would mean "it depends on the module" - the ssl_*.c / crypto*.c code
tends to "if ( NULL == ...)" while most of the rest uses "if ( ... == NULL )"
- so much for "existing coding style"...)
gert
--
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]
fax: +49-89-35655025 [email protected]
signature.asc
Description: PGP signature
