From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C7BEC3857C51; Fri, 18 Nov 2022 15:48:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C7BEC3857C51 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668786504; bh=PpT78T5Fb2hlmyUplRDs9DBMdCyndmqcKtsX+97Wkyc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Xw5ZF8TxXjpbRgudzNtyDcPEUUtuBYs2xdYKz/jMepNtWIRa/DbD0k9lhXiFA2NkV uUxn22mvLHCQKamk9mb0LoOAbRx7XMO6o/oqiyypsS75uCm701uAyHYRfpqB1wTykT NEEMdjLDgvWl8eXNJr9mbI/Y0fdKHzJ1bFqiMX0g= From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug build/29798] symtab.c doesn't compile with 32-bit GCC 12 Date: Fri, 18 Nov 2022 15:48:24 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: build X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: 13.1 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29798 --- Comment #3 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Simon Marchi : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D9c48a8e6f439= 65b8d530159e5dbb2fc9d6083646 commit 9c48a8e6f43965b8d530159e5dbb2fc9d6083646 Author: Simon Marchi Date: Fri Nov 18 10:48:03 2022 -0500 gdb: fix symtab.c build on 32 bit targets When building on Ubuntu 22.04, gcc 12, x86-64 with -m32 and -O2, I get: CXX symtab.o /home/smarchi/src/binutils-gdb/gdb/symtab.c: In member function =C3=83=C2=A2=C3=A2=C2=AC=C3=8Bstd::vector global_symbol_sear= cher::search() const=C3=83=C2=A2=C3=A2=C2=AC=C3=A2=C2=A2: /home/smarchi/src/binutils-gdb/gdb/symtab.c:4961:44: error: =C3=83=C2=A2=C3=A2=C2=AC=C3=8B__builtin___sprintf_chk=C3=83=C2=A2=C3=A2=C2= =AC=C3=A2=C2=A2 may write a terminating nul past the end of the destination [-Werror=3Dformat-overflow=3D] 4961 | sprintf (tmp, "operator%.*s%s", fix, " ", opname); | ^ In file included from /usr/include/stdio.h:894, from ../gnulib/import/stdio.h:43, from /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/common-defs.h:86, from /home/smarchi/src/binutils-gdb/gdb/defs.h:28, from /home/smarchi/src/binutils-gdb/gdb/symtab.c:2= 0: In function =C3=83=C2=A2=C3=A2=C2=AC=C3=8Bint sprintf(char*, const = char*, ...)=C3=83=C2=A2=C3=A2=C2=AC=C3=A2=C2=A2, inlined from =C3=83=C2=A2=C3=A2=C2=AC=C3=8Bstd::vector global_symbol_searcher::search() const=C3=83=C2=A2=C3=A2=C2=AC=C3=A2=C2=A2 = at /home/smarchi/src/binutils-gdb/gdb/symtab.c:4961:16: /usr/include/i386-linux-gnu/bits/stdio2.h:38:34: note: =C3=83=C2=A2=C3=A2=C2=AC=C3=8B__builtin___sprintf_chk=C3=83=C2=A2=C3=A2=C2= =AC=C3=A2=C2=A2 output between 9 and 2147483648 bytes into a destination of size 2147483647 38 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL = - 1, | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~ 39 | __glibc_objsize (__s), __= fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~ 40 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ PR build/29798 shows a similar error message but on Solaris. Work around that by using string_printf. It is a good thing to get rid of the alloca anyway. Change-Id: Ifbac11fee3062ad7f134d596b4e2229dc5d166f9 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29798 --=20 You are receiving this mail because: You are on the CC list for the bug.=