On Thu, 15 Jan 2015, Jiong Wang wrote:

> +  if (bitsize + bitnum > unit && bitnum < unit)
> +    {
> +      warning (OPT_Wextra, "write of "HOST_WIDE_INT_PRINT_UNSIGNED"bit data "
> +            "outside the bound of destination object, data truncated into "
> +            HOST_WIDE_INT_PRINT_UNSIGNED"bit", bitsize, unit - bitnum);

HOST_WIDE_INT_PRINT_UNSIGNED is a format for printf, not for the GCC 
diagnostic functions; in addition, the strings passed to the GCC 
diagnostic functions must be string constants, not concatenated with 
macros (only with other string constants directly appearing in the 
source), so that they can be extracted for translation.  You need to use 
%wu instead to print an unsigned HOST_WIDE_INT in a GCC diagnostic 
function such as warning.

(Also, there should be a hyphen between the number and "bit", "%wu-bit".)

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to