From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id BA7D8393D029 for ; Wed, 4 Aug 2021 12:04:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BA7D8393D029 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6592F13D5; Wed, 4 Aug 2021 05:04:26 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E4B7E3F719; Wed, 4 Aug 2021 05:04:25 -0700 (PDT) From: Richard Sandiford To: Eli Zaretskii via Gcc-bugs Mail-Followup-To: Eli Zaretskii via Gcc-bugs , Eli Zaretskii , richard.sandiford@arm.com Cc: Eli Zaretskii Subject: Re: Compilation of rust-demangle.c fails on MinGW References: <83h7gaprpa.fsf@gnu.org> Date: Wed, 04 Aug 2021 13:04:24 +0100 In-Reply-To: <83h7gaprpa.fsf@gnu.org> (Eli Zaretskii via Gcc-bugs's message of "Sat, 31 Jul 2021 15:56:33 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, 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-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Aug 2021 12:04:28 -0000 Hi, Eli Zaretskii via Gcc-bugs writes: > The version of rust-demangle.c included with Binutils 2.37 doesn't > compile with MinGW: > > mingw32-gcc -c -DHAVE_CONFIG_H -O2 -gdwarf-4 -g3 -I. -I../../binutils-2.37/libiberty/../include -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -Wshadow=local -pedantic -D_GNU_SOURCE ../../binutils-2.37/libiberty/rust-demangle.c -o rust-demangle.o > ../../binutils-2.37/libiberty/rust-demangle.c:84:3: error: unknown type name 'uint' > 84 | uint recursion; > | ^~~~ > ../../binutils-2.37/libiberty/rust-demangle.c: In function 'demangle_path': > ../../binutils-2.37/libiberty/rust-demangle.c:87:37: error: 'uint' undeclared (first use in this function); did you mean 'int'? > 87 | #define RUST_NO_RECURSION_LIMIT ((uint) -1) > | ^~~~ > ../../binutils-2.37/libiberty/rust-demangle.c:686:25: note: in expansion of macro 'RUST_NO_RECURSION_LIMIT' > 686 | if (rdm->recursion != RUST_NO_RECURSION_LIMIT) > | ^~~~~~~~~~~~~~~~~~~~~~~ > ../../binutils-2.37/libiberty/rust-demangle.c:87:37: note: each undeclared identifier is reported only once for each function it appears in > 87 | #define RUST_NO_RECURSION_LIMIT ((uint) -1) > | ^~~~ > ../../binutils-2.37/libiberty/rust-demangle.c:686:25: note: in expansion of macro 'RUST_NO_RECURSION_LIMIT' > 686 | if (rdm->recursion != RUST_NO_RECURSION_LIMIT) > | ^~~~~~~~~~~~~~~~~~~~~~~ > ../../binutils-2.37/libiberty/rust-demangle.c: In function 'rust_demangle_callback': > ../../binutils-2.37/libiberty/rust-demangle.c:87:37: error: 'uint' undeclared (first use in this function); did you mean 'int'? > 87 | #define RUST_NO_RECURSION_LIMIT ((uint) -1) > | ^~~~ > ../../binutils-2.37/libiberty/rust-demangle.c:1347:55: note: in expansion of macro 'RUST_NO_RECURSION_LIMIT' > 1347 | rdm.recursion = (options & DMGL_NO_RECURSE_LIMIT) ? RUST_NO_RECURSION_LIMIT : 0; > | ^~~~~~~~~~~~~~~~~~~~~~~ > > This is because the data type 'uint' is not defined in the MinGW > headers. I used uint32_t instead, and it compiled OK. This list is mostly just a bugzilla feed and so isn't widely read. Could you file a PR? Thanks, Richard