[Bug c/23964] -Wparentheses doesn't catch all assignments used as truth value
falk at debian dot org
gcc-bugzilla@gcc.gnu.org
Mon Sep 19 13:14:00 GMT 2005
------- Additional Comments From falk at debian dot org 2005-09-19 13:14 -------
(In reply to comment #2)
> Well, all these examples are assignments. I don't agree that '=' is a somewhat
> unique or special assignment.
But of course it is. It is the only case where people make mistakes.
> According to documentation (and that would be
> logically correct) any kind of assignment should be caught when used as truth
> value without additional parentheses.
"logically correct" is not a meaningful concept when dealing with warnings.
The question is rather whether they flag code that is frequently mistaken.
And I don't see that for these cases. So at best we could "fix" the
documentation, although that seems unneccesarily pedantic to me.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23964
More information about the Gcc-bugs
mailing list