[PATCH][C] Fix type problem in convert_for_assignment
Richard Guenther
rguenther@suse.de
Thu Jul 26 11:51:00 GMT 2007
This is all what remains for C type fixes in my tree.
Boostrapped and tested on x86_64-unknown-linux-gnu.
Ok for mainline?
Thanks,
Richard.
2007-07-13 Richard Guenther <rguenther@suse.de>
* c-typeck.c (convert_for_assignment): Use the type of
the member for the initialization.
Index: gcc/c-typeck.c
===================================================================
*** gcc/c-typeck.c.orig 2007-07-26 12:26:29.000000000 +0200
--- gcc/c-typeck.c 2007-07-26 12:28:35.000000000 +0200
*************** convert_for_assignment (tree type, tree
*** 4035,4040 ****
--- 4035,4041 ----
if (pedantic && (!fundecl || !DECL_IN_SYSTEM_HEADER (fundecl)))
pedwarn ("ISO C prohibits argument conversion to union type");
+ rhs = fold_convert (TREE_TYPE (memb), rhs);
return build_constructor_single (type, memb, rhs);
}
}
More information about the Gcc-patches
mailing list