public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
From: Petter Tomner <tomner@kth.se>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	"jit@gcc.gnu.org" <jit@gcc.gnu.org>
Subject: [commited] jit: Change printf specifiers for size_t to %zu
Date: Sat, 27 Nov 2021 16:02:48 +0000	[thread overview]
Message-ID: <70b200ac1db7437fadfc8cd8e61b05b7@kth.se> (raw)

[-- Attachment #1: Type: text/plain, Size: 527 bytes --]

Hi!

I've pushed a fix for %ld as printf specifiers for size_t which made 32bit builds sad, as per
Gerald Pfeifers mail to the list: https://gcc.gnu.org/pipermail/jit/2021q4/001395.html

%ld changed to %zu in four places in libgccjit.c.

Please note that I considered this patch a "free for all" since it is trivial and rather annoying
on 32bit computers and I pushed without prior approval from the jit maintainer (D. Malcolm).

make check-jit runs cleanly on gnu-linux-debian x64 and in a x86 VM.

Regards, Petter

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-jit-Change-printf-specifiers-for-size_t-to-zu.patch --]
[-- Type: text/x-patch; name="0001-jit-Change-printf-specifiers-for-size_t-to-zu.patch", Size: 1489 bytes --]

From 1e53408452448cdfa5481e25e470946c2c472539 Mon Sep 17 00:00:00 2001
From: Petter Tomner <tomner@kth.se>
Date: Sat, 27 Nov 2021 15:52:15 +0100
Subject: [PATCH] jit: Change printf specifiers for size_t to %zu

Change four occurances of %ld specifier for size_t to %zu for clean 32bit builds.

Signed-off-by
2021-11-27	Petter Tomner	<tomner@kth.se>

gcc/jit/
	* libgccjit.c: %ld -> %zu
---
 gcc/jit/libgccjit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/jit/libgccjit.c b/gcc/jit/libgccjit.c
index c744b634f4b..5d051e43e1e 100644
--- a/gcc/jit/libgccjit.c
+++ b/gcc/jit/libgccjit.c
@@ -707,7 +707,7 @@ gcc_jit_function_type_get_param_type (gcc_jit_function_type *function_type,
   gcc::jit::recording::context *ctxt = function_type->m_ctxt;
   RETURN_NULL_IF_FAIL_PRINTF3 (index < num_params,
 			       ctxt, NULL,
-			       "index of %ld is too large (%s has %ld params)",
+			       "index of %zu is too large (%s has %zu params)",
 			       index,
 			       function_type->get_debug_string (),
 			       num_params);
@@ -951,7 +951,7 @@ gcc_jit_struct_get_field (gcc_jit_struct *struct_type,
   size_t num_fields = struct_type->get_fields ()->length ();
   RETURN_NULL_IF_FAIL_PRINTF3 (index < num_fields,
 			       NULL, NULL,
-			       "index of %ld is too large (%s has %ld fields)",
+			       "index of %zu is too large (%s has %zu fields)",
 			       index,
 			       struct_type->get_debug_string (),
 			       num_fields);
-- 
2.30.2


                 reply	other threads:[~2021-11-27 16:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=70b200ac1db7437fadfc8cd8e61b05b7@kth.se \
    --to=tomner@kth.se \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jit@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).