gengtype: Use HOST_SIZE_T_PRINT_UNSIGNED in another spot

Message ID ZcpRv/JdkGPinbc1@tucnak
State Unresolved
Headers
Series gengtype: Use HOST_SIZE_T_PRINT_UNSIGNED in another spot |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Jakub Jelinek Feb. 12, 2024, 5:13 p.m. UTC
  Hi!

This patch depends on the libiberty/vprintf-support.c change.

Ok for trunk if that one is approved?

2024-02-12  Jakub Jelinek  <jakub@redhat.com>

	* gengtype.cc (adjust_field_rtx_def): Use HOST_SIZE_T_PRINT_UNSIGNED
	and cast to fmt_size_t instead of %lu and cast to unsigned long.


	Jakub
  

Comments

Richard Biener Feb. 12, 2024, 5:17 p.m. UTC | #1
> Am 12.02.2024 um 18:14 schrieb Jakub Jelinek <jakub@redhat.com>:
> 
> Hi!
> 
> This patch depends on the libiberty/vprintf-support.c change.
> 
> Ok for trunk if that one is approved?

Ok

> 2024-02-12  Jakub Jelinek  <jakub@redhat.com>
> 
>    * gengtype.cc (adjust_field_rtx_def): Use HOST_SIZE_T_PRINT_UNSIGNED
>    and cast to fmt_size_t instead of %lu and cast to unsigned long.
> 
> --- gcc/gengtype.cc.jj    2024-02-10 11:25:10.104472494 +0100
> +++ gcc/gengtype.cc    2024-02-12 10:13:49.324612173 +0100
> @@ -1344,8 +1344,10 @@ adjust_field_rtx_def (type_p t, options_
>        }
> 
>      subfields = create_field (subfields, t,
> -                    xasprintf (".fld[%lu].%s",
> -                           (unsigned long) aindex,
> +                    xasprintf (".fld["
> +                           HOST_SIZE_T_PRINT_UNSIGNED
> +                           "].%s",
> +                           (fmt_size_t) aindex,
>                           subname));
>      subfields->opt = nodot;
>      if (t == note_union_tp)
> 
>    Jakub
>
  

Patch

--- gcc/gengtype.cc.jj	2024-02-10 11:25:10.104472494 +0100
+++ gcc/gengtype.cc	2024-02-12 10:13:49.324612173 +0100
@@ -1344,8 +1344,10 @@  adjust_field_rtx_def (type_p t, options_
 	    }
 
 	  subfields = create_field (subfields, t,
-				    xasprintf (".fld[%lu].%s",
-					       (unsigned long) aindex,
+				    xasprintf (".fld["
+					       HOST_SIZE_T_PRINT_UNSIGNED
+					       "].%s",
+					       (fmt_size_t) aindex,
 					       subname));
 	  subfields->opt = nodot;
 	  if (t == note_union_tp)