On 12/20/2017 05:28 PM, Martin Sebor wrote:
> On 12/20/2017 05:07 PM, Richard Sandiford wrote:
>> Martin Sebor <mse...@gmail.com> writes:
>>> The attached patch replaces use of %lli and %llu with
>>> HOST_WIDE_INT_PRINT_DEC and HOST_WIDE_INT_PRINT_UNSIGNED
>>> for portability, and also replaces wide_int::to_shwi() with
>>> offset_int::from().
>>
>> Thanks for doing this.  I think you need to remove the (long long)
>> casts too though, so that the format stays in sync with the types.
> 
> Doh!  Thanks!  Had I waited for stage 2 bootstrap I suspect I would
> have found out when it broke due to -Wformat complaining that
> HOST_WIDE_INT_PRINT_DEC (%ld on my system) not matching the long
> long argument.
> 
> Attached is the patch with the casts removed (still bootstrapping).
> 
> Martin
> 
> gcc-printf-lli.diff
> 
> 
> gcc/ChangeLog:
> 
>       * gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Use
>       offset_int::from instead of wide_int::to_shwi.
>       (maybe_diag_overlap): Remove assertion.
>       Use HOST_WIDE_INT_PRINT_DEC instead of %lli.
>       * gimple-ssa-sprintf.c (format_directive): Same.
>       (parse_directive): Same.
>       (sprintf_dom_walker::compute_format_length): Same.
>       (try_substitute_return_value): Same.
> 
> gcc/testsuite/ChangeLog:
> 
>       * gcc.dg/Wrestrict-3.c: New test.
OK.
jeff

Reply via email to