On Thu, 2024-02-01 at 14:55 +0100, Jakub Jelinek wrote:
> On Thu, Feb 01, 2024 at 01:42:03PM +0000, Jonathan Yong wrote:
> > On 2/1/24 13:06, Xi Ruoyao wrote:
> > > On Thu, 2024-02-01 at 14:01 +0100, Jakub Jelinek wrote:
> > > > On Thu, Feb 01, 2024 at 12:45:31PM +0000, Jonathan Yong wrote:
> > > > > Attached patch OK? Copied inline for review convenience.
> > > > 
> > > > No, I think e.g. AIX doesn't support the z modifier.
> > > > I don't see %zd or %zu used anywhere except in gcc/jit/ which presumably
> > > > doesn't work on AIX.
> > > > 
> > > 
> > > Should use HOST_WIDE_INT_PRINT_UNSIGNED instead of PRIu64.
> > > 
> > Updated the patch with the suggestions.

I mean if you are casting it to unsigned HOST_WIDE_INT, you should use
HOST_WIDE_INT_PRINT_UNSIGNED,  If you are casting it to size_t you
cannot use it (as Jakub has explained).

When you use printf-like things you have to keep the correspondence
between format specifier and the argument itself, 

> No, that is wrong.  That will break bootstrap on lots of hosts, any time
> size_t is not unsigned long (if unsigned long is 64-bit) or unsigned long
> long (if unsigned long is not 64-bit).
> That includes e.g. all targets where size_t is unsigned int, and some others
> too.
> 
>       Jakub
> 

-- 
Xi Ruoyao <xry...@xry111.site>
School of Aerospace Science and Technology, Xidian University

Reply via email to