christ.li@xxxxxxxxx schrieb am 06.02.2009 05:15:37: > cast_to() seems fine. > > In expanding stage, cast_value() did not cast the constant > correctly. You're right, I also noticed this in the meantime. The decision, whether newtype is int_type or fp_type is not made correctly. The following patch seems to work: Fix implicit cast to float Signed-Off-By: Thomas Schmid <Thomas.Schmid@xxxxxxxxxxxxxxxxx> Index: sparse/expand.c =================================================================== --- sparse.orig/expand.c 2009-02-06 11:37:17.717913100 +0100 +++ sparse/expand.c 2009-02-06 11:37:34.973482600 +0100 @@ -116,7 +116,7 @@ Int: return; Float: - if (newtype->ctype.base_type != &fp_type) { + if (is_int_type(newtype)) { value = (long long)old->fvalue; expr->type = EXPR_VALUE; expr->taint = 0; @@ -126,7 +126,7 @@ Float: if (oldtype->ctype.base_type != &fp_type) expr->fvalue = (long double)get_longlong(old); else - expr->fvalue = old->value; + expr->fvalue = old->fvalue; if (!(newtype->ctype.modifiers & MOD_LONGLONG)) { if ((newtype->ctype.modifiers & MOD_LONG)) -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html