From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 590EF3858D28; Mon, 11 Dec 2023 16:12:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 590EF3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1702311123; bh=4cqJMAWiDxkzcug4CZdz+3CCf7FBFzt4KQ7kRZrXby8=; h=From:To:Subject:Date:From; b=mEIXDG06Y/PofUxKBL448PtaAjsmV65ULNMTkvtp4M2mcD0aNcfAc87ZuN+2fVdPx 8Uuvfzux0T6yTk17uFf2eTdGKij57nVV/hDPXWRW9jWDi2WblXV+vYZFjiq+GC5MbP H07weDpS7nc3ef5+pWhmHmrpQu/Lkm3JDHl4YkfM= From: "jremus at linux dot ibm.com" To: gdb-prs@sourceware.org Subject: [Bug build/31141] New: gdbsupport fails to compile with clang due to missing C++ prototype for operator delete Date: Mon, 11 Dec 2023 16:12:02 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: jremus at linux dot ibm.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D31141 Bug ID: 31141 Summary: gdbsupport fails to compile with clang due to missing C++ prototype for operator delete Product: gdb Version: HEAD Status: UNCONFIRMED Severity: normal Priority: P2 Component: build Assignee: unassigned at sourceware dot org Reporter: jremus at linux dot ibm.com Target Milestone: --- gdbsupport fails to compile with clang on s390x and x86 since commit 553b78748fd ("Rely on C++17 in new-op.cc") as follows: $ make make all-recursive make[1]: Entering directory '/home/jremus/my-dev-stuff/binutils-build/gdbsupport' make[2]: Entering directory '/home/jremus/my-dev-stuff/binutils-build/gdbsupport' CXX new-op.o ../../binutils-gdb/gdbsupport/new-op.cc:114:1: error: no previous prototype= for function 'operator delete' [-Werror,-Wmissing-prototypes] operator delete (void *p, std::size_t) noexcept ^ ../../binutils-gdb/gdbsupport/new-op.cc:113:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void ^ static ../../binutils-gdb/gdbsupport/new-op.cc:132:1: error: no previous prototype= for function 'operator delete[]' [-Werror,-Wmissing-prototypes] operator delete[] (void *p, std::size_t) noexcept ^ ../../binutils-gdb/gdbsupport/new-op.cc:131:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void ^ static 2 errors generated. make[2]: *** [Makefile:554: new-op.o] Error 1 make[2]: Leaving directory '/home/jremus/my-dev-stuff/binutils-build/gdbsupport' make[1]: *** [Makefile:574: all-recursive] Error 1 make[1]: Leaving directory '/home/jremus/my-dev-stuff/binutils-build/gdbsupport' make: *** [Makefile:446: all] Error 2 It works again when reverting commit 553b78748fd ("Rely on C++17 in new-op.cc"). My approach to build with clang are as follows: cd $HOME git clone git://sourceware.org/git/binutils-gdb.git mkdir binutils-build cd binutils-build CC=3Dclang CXX=3Dclang++ ../binutils-gdb/configure make My above test build on x86 was on Fedora 38 with clang 16.0.6 and gcc C++ system header files from package libstdc++-devel 13.2.1. --=20 You are receiving this mail because: You are on the CC list for the bug.=