From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.CeBiTec.Uni-Bielefeld.DE (smtp.CeBiTec.Uni-Bielefeld.DE [129.70.160.84]) by sourceware.org (Postfix) with ESMTPS id 043203858CDB; Thu, 18 Jan 2024 09:13:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 043203858CDB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=CeBiTec.Uni-Bielefeld.DE Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cebitec.uni-bielefeld.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 043203858CDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=129.70.160.84 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705569220; cv=none; b=N5WNkE+F8/aTux/IdPDp39Mgx2bCpW/pjB2uu2ScBbR++wgg9FR1okEKfxOdGZdhQV4tCbuB03zhohiNltqkVLVIujkPWqBrfSZ+MEXWQ/jzqPFBSGPteYnDh1iHIYHd6B5HHMqYQtufTG0CPmAUoV7uGDCHB57V4wBxVIhVtzE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705569220; c=relaxed/simple; bh=zP6tx7cVXFf7dASmjoRpOn0EY8Ht1jrwXLxFEsQzIPs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=qLEAj+UaNtkEDmP6g3mNpAfgE/6OPXJRhvXKn8HxDrIl+cIy8KSAxQMDzWNhkJGyCfjJ+LUy1d7bSLqe1fHKdPUsIT0iC8oOZXkDobukED67c2j7FgGXmWGkc2rENAucrlxYS7LY8VqWvl/Om2ZywYU9JjfyjKLAblyS9w0jB6o= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from localhost (localhost [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id EED48CA963; Thu, 18 Jan 2024 10:13:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= cebitec.uni-bielefeld.de; h=content-type:content-type :mime-version:user-agent:message-id:in-reply-to:date:date :references:subject:subject:from:from:received:received; s= 20200306; t=1705569216; bh=zP6tx7cVXFf7dASmjoRpOn0EY8Ht1jrwXLxFE sQzIPs=; b=Vz3Rg9ZHmm0IAkwBHCp3m6HBAseQL2IUNto5cbtvg/2tlN4aLGFFz MoSyDMhIlEZ8TZsw3ZU5OhRxa9EL0m0wJ/F3J8Juur1l5QXIilbJAVXMVvWDyImS l53gRdhP6LlS616Xp3fgb9dFxrbondAt5Tee5C4KN5A+HbeKFW16mv6zh1lRCB+q FWK/5pLE0i61DVf4Q6ISD+v8TIAgpRlPnAjcMdoBCafVi5xB7GsjlVay0CYbN3x2 57B4A5rlB4WQNkSKwapcOGdmxLdGtoWy9gC8YEr0yK33HBvhnVRImMdxxe7IaZA+ S8R598o1GN3BxaoB8W9E41aPeHU4KPrzA== X-Virus-Scanned: amavisd-new at cebitec.uni-bielefeld.de Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (smtp.cebitec.uni-bielefeld.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id e68gtAjRmK45; Thu, 18 Jan 2024 10:13:36 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (p5085469a.dip0.t-ipconnect.de [80.133.70.154]) (Authenticated sender: ro) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id 499A9CAAD8; Thu, 18 Jan 2024 10:13:36 +0100 (CET) From: Rainer Orth To: Arthur Cohen Cc: gcc-patches@gcc.gnu.org, gcc-rust@gcc.gnu.org Subject: Re: [COMMITTED] rust_debug: Cast size_t values to unsigned long before printing. References: <20240118090056.2910410-2-arthur.cohen@embecosm.com> Date: Thu, 18 Jan 2024 10:13:35 +0100 In-Reply-To: <20240118090056.2910410-2-arthur.cohen@embecosm.com> (Arthur Cohen's message of "Thu, 18 Jan 2024 10:00:47 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.90 (usg-unix-v) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-3790.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,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 List-Id: Arthur Cohen writes: > 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 But we do have uses of %zu in gcc/rust already! > 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); Not the best way either: array->length is std::uint64_t, so the format should use ... %" PRIu64 " procedural... instead. I've attached my patch to PR rust/113461. Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University