Skip to content

Commit

Permalink
(convert_and_check): Don't warn converting 0xff
Browse files Browse the repository at this point in the history
to a signed char, etc., unless pedantic.

From-SVN: r5944
  • Loading branch information
Richard Stallman committed Oct 30, 1993
1 parent 708e813 commit 22ba338
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gcc/c-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,12 @@ convert_and_check (type, expr)
if (!(TREE_UNSIGNED (type) < TREE_UNSIGNED (TREE_TYPE (expr))
&& TREE_CODE (TREE_TYPE (expr)) == INTEGER_TYPE
&& TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (expr))))
warning ("overflow in implicit constant conversion");
/* If EXPR fits in the unsigned version of TYPE,
don't warn unless pedantic. */
if (pedantic
|| TREE_UNSIGNED (type)
|| ! int_fits_type_p (expr, unsigned_type (type)))
warning ("overflow in implicit constant conversion");
}
else
unsigned_conversion_warning (t, expr);
Expand Down

0 comments on commit 22ba338

Please sign in to comment.