This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

suggest parentheses around assignment used as truth value


I'd just like to register my opiniont that code like

if (x = p()) {...}

shouldn't generate a warning under gcc -Wall.  Even if
you feel that code like this is obscure, the recommended

if ((x = p())) {...}

is just bizarre.

---
Marc



-----== Sent via Deja News, The Discussion Network ==-----
http://www.dejanews.com/  Easy access to 50,000+ discussion forums


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]