diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-19 04:26:48 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-19 04:26:48 +0000 |
commit | 2d3d3af78ed241a28055e9c55b56ac10cd26f163 (patch) | |
tree | 88e3a4c343c0451d6503bcf8bbc10d367c847071 /gcc/c-family/c-common.c | |
parent | 545d4a44f46239f987cf90135be44178f04bc98a (diff) | |
download | gcc-2d3d3af78ed241a28055e9c55b56ac10cd26f163.tar.gz |
* c-common.c (shorten_compare): Don't -Wtype-limits if the
non-constant operand comes from a macro.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230589 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family/c-common.c')
-rw-r--r-- | gcc/c-family/c-common.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index f50ca48f4f2..068a0bcd2ec 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -4650,7 +4650,9 @@ shorten_compare (location_t loc, tree *op0_ptr, tree *op1_ptr, type = c_common_unsigned_type (type); } - if (TREE_CODE (primop0) != INTEGER_CST) + if (TREE_CODE (primop0) != INTEGER_CST + /* Don't warn if it's from a macro. */ + && !from_macro_expansion_at (EXPR_LOCATION (primop0))) { if (val == truthvalue_false_node) warning_at (loc, OPT_Wtype_limits, |