This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] C frontend: cast-expressions sometimes retain type qualifiers


On Sat, Aug 16, 2014 at 09:54:33PM -0400, Patrick Palka wrote:
> --- a/gcc/c/c-typeck.c
> +++ b/gcc/c/c-typeck.c
> @@ -4947,6 +4947,8 @@ build_c_cast (location_t loc, tree type, tree expr)
>  	  || TREE_CODE (type) == UNION_TYPE)
>  	pedwarn (loc, OPT_Wpedantic,
>  		 "ISO C forbids casting nonscalar to the same type");
> +
> +      value = convert (type, value);

Maybe a comment saying why we convert the value here anyway would be
useful.  Otherwise LGTM.

	Marek


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]