This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/17257] Some assignment operators do not trigger "assignment used as * truth value" warning
- From: "jsm at polyomino dot org dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Sep 2004 00:17:51 -0000
- Subject: [Bug c/17257] Some assignment operators do not trigger "assignment used as * truth value" warning
- References: <20040901001242.17257.tlambert2@mindspring.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From jsm at polyomino dot org dot uk 2004-09-01 00:17 -------
Subject: Re: New: Some assignment operators do not trigger
"assignment used as * truth value" warning
On Wed, 1 Sep 2004, tlambert2 at mindspring dot com wrote:
> /*
> * Some assignment operators do not trigger "assignment used as
> * truth value" warning. This seems wrong. The following code,
> * when compiled with "-Wall" only causes the compiler to emit a
> * single warning, only for the direct assignment. The same effect
> * is present on Macintosh (gcc 3.3 PPC) and Linux x86 platforms.
> */
This is by design. The warning is specifically for potential confusion
between = and ==.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17257