This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: backport the fixes of PR target/64011 and /61749 to 4.9 gcc
- From: Joseph Myers <joseph at codesourcery dot com>
- To: weixiangyu <weixiangyu at huawei dot com>
- Cc: James Greenhalgh <james dot greenhalgh at arm dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>
- Date: Wed, 10 Jun 2015 10:17:42 +0000
- Subject: RE: backport the fixes of PR target/64011 and /61749 to 4.9 gcc
- Authentication-results: sourceware.org; auth=none
- References: <894B9D8AA7173E40BFFBBF195B8281BCB75B4B at SZXEMI503-MBX dot china dot huawei dot com> <20150528135737 dot GA3964 at arm dot com> <894B9D8AA7173E40BFFBBF195B8281BCB76A18 at SZXEMI503-MBX dot china dot huawei dot com>
On Wed, 10 Jun 2015, weixiangyu 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 printf format, which depends on the host
and is not suitable for any translatable string, not a format for GCC's
pretty printers. Use %wu instead in any call to a GCC diagnostic
function. Mainline appears to have this correct.
--
Joseph S. Myers
joseph@codesourcery.com