From patchwork Sat Nov 27 16:02:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petter Tomner X-Patchwork-Id: 48228 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E4FB93857C43 for ; Sat, 27 Nov 2021 16:03:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E4FB93857C43 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1638029001; bh=92N0Qbd6nJesA1dL93SDt2sb7I0UUkbOY3j5f/OKYAE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=xObEjPAYwOqU5Ltg7XOvc56gv7UOYee6BX8HbOsjhOCh/Lid+EuLGT1aGnNRBzaan 4FEtjuQ7RpstfYKoxnYb5Rsh3Ihwr9iZvLr8zHBrSUrZiDpHUglwXywsqGyFPlucuW 0WDtTmwp2rkmEdB8y5s/lTWQ8mvAMkfnSC1GDoxE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-relay-3.sys.kth.se (smtp-relay-3.sys.kth.se [IPv6:2001:6b0:1:1200:250:56ff:fead:700c]) by sourceware.org (Postfix) with ESMTPS id 20C663858C3A; Sat, 27 Nov 2021 16:02:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 20C663858C3A Received: from exdb5.ug.kth.se (exdb5.ug.kth.se [192.168.32.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp-relay-3.sys.kth.se (Postfix) with ESMTPS id 4J1bx54NbjzPNQZ; Sat, 27 Nov 2021 17:02:48 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp-relay-3.sys.kth.se 4J1bx54NbjzPNQZ Received: from exdb6.ug.kth.se (192.168.32.61) by exdb5.ug.kth.se (192.168.32.60) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Sat, 27 Nov 2021 17:02:48 +0100 Received: from exdb6.ug.kth.se ([192.168.32.61]) by exdb6.ug.kth.se ([192.168.32.61]) with mapi id 15.02.0986.014; Sat, 27 Nov 2021 17:02:48 +0100 To: "gcc-patches@gcc.gnu.org" , "jit@gcc.gnu.org" Subject: [commited] jit: Change printf specifiers for size_t to %zu Thread-Topic: [commited] jit: Change printf specifiers for size_t to %zu Thread-Index: AQHX45o3HVDTxUGAG0SpzGz9afG5Eg== Date: Sat, 27 Nov 2021 16:02:48 +0000 Message-ID: <70b200ac1db7437fadfc8cd8e61b05b7@kth.se> Accept-Language: sv-SE, en-US Content-Language: sv-SE X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [192.168.32.250] MIME-Version: 1.0 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Petter Tomner via Gcc-patches From: Petter Tomner Reply-To: Petter Tomner Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" 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 From 1e53408452448cdfa5481e25e470946c2c472539 Mon Sep 17 00:00:00 2001 From: Petter Tomner 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 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