This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: warning on assignment within conditional
- From: "John (Eljay) Love-Jensen" <eljay at adobe dot com>
- To: John Boncek <jboncek at Hunter dot COM>, "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Wed, 10 Feb 2010 11:45:58 -0800
- Subject: RE: warning on assignment within conditional
- References: <27536657.post@talk.nabble.com>
Hi John,
> Is there a warning option that can catch the common blunder
> if (x = y) ...
> when assignment was not intended? I can't find one in our documentation.
Yes, use:
gcc -Wparentheses foo.c
Also enabled by:
gcc -Wall foo.c
> By the way, I know it's usual to state the version of gcc being used when asking almost any question, but I don't know what version it is. How can I find out the version? It's for the iwmmxt_le architecture.
gcc --version
HTH,
--Eljay