This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C PATCH] Warn if switch has boolean value (PR c/60439)
- From: Steven Bosscher <stevenb dot gcc at gmail dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Fri, 18 Apr 2014 13:20:59 +0200
- Subject: Re: [C PATCH] Warn if switch has boolean value (PR c/60439)
- Authentication-results: sourceware.org; auth=none
- References: <20140418053021 dot GH20332 at redhat dot com>
On Fri, Apr 18, 2014 at 7:30 AM, Marek Polacek wrote:
> + if (TREE_CODE (type) == BOOLEAN_TYPE
> + || exp_code == TRUTH_ANDIF_EXPR
> + || exp_code == TRUTH_AND_EXPR
> + || exp_code == TRUTH_ORIF_EXPR
> + || exp_code == TRUTH_OR_EXPR
> + || exp_code == TRUTH_XOR_EXPR
> + || exp_code == TRUTH_NOT_EXPR
> + || exp_code == EQ_EXPR
> + || exp_code == NE_EXPR
> + || exp_code == LE_EXPR
> + || exp_code == GE_EXPR
> + || exp_code == LT_EXPR
> + || exp_code == GT_EXPR)
Is there a TREE_CODE_CLASS or a #define for this?
Ciao!
Steven