From patchwork Thu Jan 18 09:00:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 189128 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp211652dyb; Thu, 18 Jan 2024 01:02:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IHM5iCKqzGAgNOf9TFg1UUtj4SypjtZkcO7UpUGJqgwU/wJRN9X3vkaet9DZaKO0QFq0C76 X-Received: by 2002:a05:620a:25d3:b0:783:48de:de2a with SMTP id y19-20020a05620a25d300b0078348dede2amr490718qko.96.1705568551572; Thu, 18 Jan 2024 01:02:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705568551; cv=pass; d=google.com; s=arc-20160816; b=nlFSvjJ6qDtZ4P0DAn68yzJM0f1ZemwCNBVb0sWDp3MIJndreqqR+7MpCNNqeCfOuu skzufShgi+jFHPDRLNOeU7+ziH4Z92+uFV2HvD/7p8TVzpLiCSjMMSxKRqBzkqctpxQO 9o9kY9uQ2Bc0nHjd7ewVkXQxRDXOqo86LwLWT94yGCI3I0JnOA1g8WYl2uS3PJGt5X1D r+Tld0iDL5+/kQIEdwboOXKLwvYPQ8FXURBwFvVbzpwE1bBqArm21dezHjkJ6swACkfd iflIpTEN6vn3axRL5ozoBRewZJIAMTEffwFkT4yN2n7w6g4hC9k6q0jM7pn2gzOu8g/9 7UYg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=ZQAMZZF0BCxgdNBFYlAgJ43jjpnmtWmZvOnnf3MJ+ts=; fh=6KiXNvQww/MsyVplklPLl//mUuD+DtDm73nSHh4O4+g=; b=As4yRKd1sSlquupOanSfrgahLgEfndtVgRPnEFgvKVBXp3gQ8B+iO+6A+YEoxkzsLR Q7WZGSY/Vr2IdvAMNmTBswKit926xMShIaNeYbFYcPM8QZn+Bd2FzVAFNaz91NA/qGcM VJV/j76n50aF/ml9CsvsI1OW3vaQceZYuceGeLS6S1REeNU/CjzE+JR0MYW05Xg/nSYe ygCuomLUvHWvFHUhYPxlT70iYmofMF0kVzzN+ZMxzMTiC2ffmieILv16Jsyhem5MRsrG 35R8BjxCFsVBF6pByYWN9WbTRijezHnSD69mfjE30UzY32eByNtWpycg6DEY5YpKnQKl PYmA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=SvE7IGsO; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id pc1-20020a05620a840100b0078158ded522si12672008qkn.635.2024.01.18.01.02.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 01:02:31 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=SvE7IGsO; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4A0633858C56 for ; Thu, 18 Jan 2024 09:02:31 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by sourceware.org (Postfix) with ESMTPS id 905123858CDB for ; Thu, 18 Jan 2024 09:01:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 905123858CDB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 905123858CDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::534 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705568497; cv=none; b=wB2P6UtY+ILjJNm4ZCfDejQjucBnU0Z1Vrhq/nWdunYiaiaBOIeBU6GfZEQsw0uGu5PZTZqIk9UV/YkNIYrt9oCKqejYlITFqp2BzpQB6uJEo4/pV/bpURhVu2lNfDFYOstSm9MVRCTUrp5xLUZLvb8/91CIWBrDpfEEu/PjzKI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705568497; c=relaxed/simple; bh=6rMENZH2+tSR1gUX23QLFyLooc59TZPhMr6VB4Oen6Y=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=s6HwYmHtYdQxrQERPrXtV7/XyQ05imwaFNtQW9I8FSPIgjMljJdaKw+/7TwCp+OV0Encjynbo/x2hBuuCueis8nihAKyjOGbWjVCQt9zOSzvu69hVi0StZos3imhQ3wKbSoiCgvNpcO+WcVSDs7YjUTYhRNdO9zkrSGs1Mqb8DI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-559b6786561so2847279a12.2 for ; Thu, 18 Jan 2024 01:01:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1705568485; x=1706173285; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZQAMZZF0BCxgdNBFYlAgJ43jjpnmtWmZvOnnf3MJ+ts=; b=SvE7IGsO4mWv3aa6KRm2LcyX0wugFPTNrPA+0g1yK8pUq9zzbACi9tn6NLKecTGN4C KzvvIdEU2q6A6ACon4/GNkElVPj8hxMDpAfGWL54KS8N+iXvL6gY6N/XuiOK/dn9NskU eaV8yhhF7kpey+4lpczjZAXj2NG4cloGYkiGIhOkYD7Q8fDzdrPF6elUUVLomtsTFST7 jY9W91aeYkW8+UjAgYwKWbsSxoyV2CxrtqzU0jw8+SWac0pz84qERuLNorQSB9ZkB1ot k9xB4GUOYpT8+tgiFb2QY9ej+90wruF9mJAuTbuzw1+J5iL0QoQLXFEwmy/TEkAFA+jc lA5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705568485; x=1706173285; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZQAMZZF0BCxgdNBFYlAgJ43jjpnmtWmZvOnnf3MJ+ts=; b=TYgu4x4eukHcA7pY9/ooO14bmrjpxLatFIcArw1FsDiql6tU32lQGX5BYMQ+4FynET AN/9++qrf57YIz6SvufdSQBUULyUvcvObTqNBCb6/rFH/GPnVt6hZyVjyinmFzaOp6rE vFj65yKa4RHUr0s/nxC+aHjI5SOxrngWxHeGk4DoSeWU/wHUSwRBctoLVZcZjK0VhJ6P JDfcUhHmVw2ZNrA2nwPsWwWQtre4IBD8mV3KOhBdDyToyqXNBW+J4CaquQVf/R71OriB xTBVi8q63VCJoI4JMSPuPgucCao+m/pT235SbOrEImtBN+TZR52TbfMhd47infZ7mdnx NMIQ== X-Gm-Message-State: AOJu0YxcUhUuYfb+TZ8TQVj/V/kcdb/AGAcUF9k0yQvw6SouZxIJ/KPe BC2g/dDrJOcV/3Mdv8tQaA8h5rnam6ilTS+R3xnL20ctpZazy9Y92KxjGtGtaInmsFmRGm6sPmq yTg== X-Received: by 2002:a05:6402:1516:b0:557:7764:b6ae with SMTP id f22-20020a056402151600b005577764b6aemr296497edw.11.1705568485415; Thu, 18 Jan 2024 01:01:25 -0800 (PST) Received: from platypus.lan ([2a04:cec0:1900:a7b4:bb12:e41d:b68e:bb1e]) by smtp.gmail.com with ESMTPSA id eg42-20020a05640228aa00b00559b1b070a6sm3082576edb.32.2024.01.18.01.01.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 01:01:25 -0800 (PST) From: Arthur Cohen To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Arthur Cohen Subject: [COMMITTED] rust_debug: Cast size_t values to unsigned long before printing. Date: Thu, 18 Jan 2024 10:00:47 +0100 Message-ID: <20240118090056.2910410-2-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.42.1 MIME-Version: 1.0 X-Spam-Status: No, score=-14.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788418249590270937 X-GMAIL-MSGID: 1788418249590270937 Using %lu to format size_t values breaks 32 bit targets, and %zu is not supported by one of the hosts GCC aims to support - HPUX gcc/rust/ChangeLog: * backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address): Cast size_t value to unsigned long. * expand/rust-proc-macro.cc (load_macros): Likewise. * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise. --- gcc/rust/backend/rust-compile-base.cc | 3 ++- gcc/rust/expand/rust-proc-macro.cc | 2 +- gcc/rust/typecheck/rust-hir-type-check-expr.cc | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gcc/rust/backend/rust-compile-base.cc b/gcc/rust/backend/rust-compile-base.cc index b4a3685ad93..ae9f6707b72 100644 --- a/gcc/rust/backend/rust-compile-base.cc +++ b/gcc/rust/backend/rust-compile-base.cc @@ -965,7 +965,8 @@ HIRCompileBase::resolve_method_address (TyTy::FnType *fntype, } const Resolver::PathProbeCandidate *selectedCandidate = nullptr; - rust_debug_loc (expr_locus, "resolved to %lu candidates", candidates.size ()); + rust_debug_loc (expr_locus, "resolved to %lu candidates", + (unsigned long) candidates.size ()); // filter for the possible case of non fn type items std::set filteredFunctionCandidates; diff --git a/gcc/rust/expand/rust-proc-macro.cc b/gcc/rust/expand/rust-proc-macro.cc index e8618485b71..09680733e98 100644 --- a/gcc/rust/expand/rust-proc-macro.cc +++ b/gcc/rust/expand/rust-proc-macro.cc @@ -171,7 +171,7 @@ load_macros (std::string path) if (array == nullptr) return {}; - rust_debug ("Found %lu procedural macros", array->length); + rust_debug ("Found %lu procedural macros", (unsigned long) array->length); return std::vector (array->macros, array->macros + array->length); diff --git a/gcc/rust/typecheck/rust-hir-type-check-expr.cc b/gcc/rust/typecheck/rust-hir-type-check-expr.cc index 9dbf657958d..030e5f1b63c 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-expr.cc +++ b/gcc/rust/typecheck/rust-hir-type-check-expr.cc @@ -1122,10 +1122,10 @@ TypeCheckExpr::visit (HIR::MethodCallExpr &expr) auto candidate = *candidates.begin (); rust_debug_loc (expr.get_method_name ().get_locus (), - "resolved method to: {%u} {%s} with [%zu] adjustments", + "resolved method to: {%u} {%s} with [%lu] adjustments", candidate.candidate.ty->get_ref (), candidate.candidate.ty->debug_str ().c_str (), - candidate.adjustments.size ()); + (unsigned long) candidate.adjustments.size ()); // Get the adjusted self Adjuster adj (receiver_tyty);