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]
Other format: [Raw text]

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


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