From: Joern Rennecke Date: Mon, 26 Aug 2013 16:52:19 +0000 (+0000) Subject: re PR c/35649 (Incorrect printf warning: expect double has float) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0fdd4508af3f61f9e4fd24ff4d99013db3ae82c7;p=gcc.git re PR c/35649 (Incorrect printf warning: expect double has float) 2013-08-26 Joern Rennecke Joseph Myers c/35649 * c-typeck.c (c_common_type): Prefer double_type_node over other REAL_TYPE types with the same precision. (convert_arguments): Likewise. Amend patch as suggested: From: "Joseph S. Myers" In convert_arguments I think you should be comparing TYPE_MAIN_VARIANT (valtype) against double_type_node and long_double_type_node, rather than just valtype. This is PR c/35649 (so include that number in your ChangeLog entry and close that bug as fixed). Co-Authored-By: Joseph Myers From-SVN: r202006 --- diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 4d32d6dce3d..0d9ff67a7be 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,5 +1,7 @@ 2013-08-26 Joern Rennecke + Joseph Myers + c/35649 * c-typeck.c (c_common_type): Prefer double_type_node over other REAL_TYPE types with the same precision. (convert_arguments): Likewise. diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index 5daae23d141..8b3e3d92f15 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -3164,8 +3164,8 @@ convert_arguments (tree typelist, vec *values, else if (TREE_CODE (valtype) == REAL_TYPE && (TYPE_PRECISION (valtype) <= TYPE_PRECISION (double_type_node)) - && valtype != double_type_node - && valtype != long_double_type_node + && TYPE_MAIN_VARIANT (valtype) != double_type_node + && TYPE_MAIN_VARIANT (valtype) != long_double_type_node && !DECIMAL_FLOAT_MODE_P (TYPE_MODE (valtype))) { if (type_generic)