From patchwork Tue Mar 3 22:34:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 38397 Received: (qmail 77278 invoked by alias); 3 Mar 2020 22:34:47 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 77266 invoked by uid 89); 3 Mar 2020 22:34:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_SOFTFAIL autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: barracuda.ebox.ca Received: from barracuda.ebox.ca (HELO barracuda.ebox.ca) (96.127.255.19) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 03 Mar 2020 22:34:45 +0000 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id RVdYa4qHnB8MXtR5 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 03 Mar 2020 17:34:43 -0500 (EST) Received: from smarchi-efficios.internal.efficios.com (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) by smtp.ebox.ca (Postfix) with ESMTP id 6CDFF441B21; Tue, 3 Mar 2020 17:34:43 -0500 (EST) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH] gdb: enable -Wmissing-prototypes warning Date: Tue, 3 Mar 2020 17:34:42 -0500 Message-Id: <20200303223442.330-1-simon.marchi@efficios.com> MIME-Version: 1.0 While compiling with clang, I noticed it didn't catch cases where my function declaration didn't match my function definition. This is normally caught by gcc with -Wmissing-declarations. On clang, this is caught by -Wmissing-prototypes instead. Note that on gcc, -Wmissing-prototypes also exists, but is only valid for C and Objective-C. It gets correctly rejected by the configure script since gcc rejects it with: cc1plus: error: command line option '-Wmissing-prototypes' is valid for C/ObjC but not for C++ -Werror So this warning flag ends up not used for gcc (which is what we want). gdb/ChangeLog: * configure: Re-generate. gdbserver/ChangeLog: * configure: Re-generate. gdbsupport/ChangeLog: * configure: Re-generate. * warning.m4: Enable -Wmissing-prototypes. --- gdb/configure | 1 + gdbserver/configure | 1 + gdbsupport/configure | 1 + gdbsupport/warning.m4 | 1 + 4 files changed, 4 insertions(+) diff --git a/gdb/configure b/gdb/configure index f99cbe40f11f..47ca77f400c8 100755 --- a/gdb/configure +++ b/gdb/configure @@ -16323,6 +16323,7 @@ build_warnings="-Wall -Wpointer-arith \ -Wdeprecated-copy-dtor \ -Wredundant-move \ -Wmissing-declarations \ +-Wmissing-prototypes \ -Wstrict-null-sentinel \ " diff --git a/gdbserver/configure b/gdbserver/configure index be5719eb77aa..13ac7188454d 100755 --- a/gdbserver/configure +++ b/gdbserver/configure @@ -9616,6 +9616,7 @@ build_warnings="-Wall -Wpointer-arith \ -Wdeprecated-copy-dtor \ -Wredundant-move \ -Wmissing-declarations \ +-Wmissing-prototypes \ -Wstrict-null-sentinel \ " diff --git a/gdbsupport/configure b/gdbsupport/configure index a4871f8d5bce..11ebee513c40 100755 --- a/gdbsupport/configure +++ b/gdbsupport/configure @@ -10871,6 +10871,7 @@ build_warnings="-Wall -Wpointer-arith \ -Wdeprecated-copy-dtor \ -Wredundant-move \ -Wmissing-declarations \ +-Wmissing-prototypes \ -Wstrict-null-sentinel \ " diff --git a/gdbsupport/warning.m4 b/gdbsupport/warning.m4 index 81939ed76102..649be7552dd1 100644 --- a/gdbsupport/warning.m4 +++ b/gdbsupport/warning.m4 @@ -51,6 +51,7 @@ build_warnings="-Wall -Wpointer-arith \ -Wdeprecated-copy-dtor \ -Wredundant-move \ -Wmissing-declarations \ +-Wmissing-prototypes \ -Wstrict-null-sentinel \ "