From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fencepost.gnu.org (fencepost.gnu.org [IPv6:2001:470:142:3::e]) by sourceware.org (Postfix) with ESMTPS id 66CDB3858C3A for ; Sat, 31 Jul 2021 12:56:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 66CDB3858C3A Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1734 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9oXp-0007zM-Ow for gcc-bugs@gcc.gnu.org; Sat, 31 Jul 2021 08:56:50 -0400 Date: Sat, 31 Jul 2021 15:56:33 +0300 Message-Id: <83h7gaprpa.fsf@gnu.org> From: Eli Zaretskii To: gcc-bugs@gcc.gnu.org Subject: Compilation of rust-demangle.c fails on MinGW X-Spam-Status: No, score=2.5 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Level: ** 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: Sat, 31 Jul 2021 12:56:51 -0000 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.