This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Always generate warning/error for assignment as truth value
- From: "Ching, Jimen \(US SSA\)" <jimen dot ching at baesystems dot com>
- To: <gcc at gcc dot gnu dot org>
- Date: Wed, 2 May 2007 11:11:27 -1000
- Subject: Always generate warning/error for assignment as truth value
Hi,
I was wondering if there's an option to gcc/g++ to make it generate a
warning/error when an assignment is used as a truth value in an
expression.
The -Wall option does this. But it can be silenced with parentheses.
The problem is, macros often use parentheses around expressions. Thus,
this warning is silenced for macros.
Perhaps, in a macro, double parentheses are needed could solve this
problem.
--jc
--
BAE Systems NS I&S
810 Richards Street, Ste. 124
Honolulu, HI 96813
Phone: 808 441-2563