Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: John Baldwin <jhb@FreeBSD.org>
To: Simon Marchi <simon.marchi@efficios.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 01/15] Add back declarations for _initialize functions
Date: Thu, 09 Jan 2020 18:46:00 -0000	[thread overview]
Message-ID: <f34cc19e-f4df-82eb-4e35-9132c9f84eea@FreeBSD.org> (raw)
In-Reply-To: <20191125052655.22696-2-simon.marchi@efficios.com>

On 11/24/19 9:26 PM, Simon Marchi wrote:
> I'd like to enable the -Wmissing-declarations warning.  However, it
> warns for every _initialize function, for example:
> 
>       CXX    dcache.o
>     /home/smarchi/src/binutils-gdb/gdb/dcache.c: In function ‘void _initialize_dcache()’:
>     /home/smarchi/src/binutils-gdb/gdb/dcache.c:688:1: error: no previous declaration for ‘void _initialize_dcache()’ [-Werror=missing-declarations]
>      _initialize_dcache (void)
>      ^~~~~~~~~~~~~~~~~~
> 
> The only practical way forward I found is to add back the declarations,
> which were removed by this commit:
> 
>     commit 481695ed5f6e0a8a9c9c50bfac1cdd2b3151e6c9
>     Author: John Baldwin <jhb@FreeBSD.org>
>     Date:   Sat Sep 9 11:02:37 2017 -0700
> 
>         Remove unnecessary function prototypes.
> 
> I don't think it's a big problem to have the declarations for these
> functions, but if anybody has a better solution for this, I'll be happy
> to use it.

(Sorry for the late reply, but I don't think I've seen this pushed in yet?)

I don't have a better solution.  I feel like clang warned about the
declarations perhaps, but I can't find the reason for making this change
in the old branch.  It might be worth testing a build with clang to see
if this adds new warnings there or not.  I can help with doing that if needed.
If it does trigger a warning on clang we might also just choose to mute that
warning (I think since the original commit we have added the ability to have
clang- and gcc-specific warning flags).

-- 
John Baldwin


  reply	other threads:[~2020-01-09 18:46 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-25  5:27 [PATCH 00/15] Enable -Wmissing-declarations diagnostic Simon Marchi
2019-11-25  5:27 ` [PATCH 07/15] Remove unused overload of exit_inferior_silent Simon Marchi
2019-11-25  5:27 ` [PATCH 13/15] Remove simulator_command declaration, make static Simon Marchi
2019-11-25  5:27 ` [PATCH 01/15] Add back declarations for _initialize functions Simon Marchi
2020-01-09 18:46   ` John Baldwin [this message]
2020-01-09 22:23     ` Simon Marchi
2020-01-09 22:33       ` Tom Tromey
2020-01-09 22:50         ` Simon Marchi
2020-01-10 18:43           ` Tom Tromey
2020-01-10 21:46             ` Simon Marchi
2019-11-25  5:27 ` [PATCH 12/15] Make functions static in unittests Simon Marchi
2019-11-25  5:27 ` [PATCH 04/15] Remove unused function set_gdb_completion_word_break_characters Simon Marchi
2019-11-25  5:27 ` [PATCH 02/15] Include aarch32-tdep.h in aarch32-tdep.c Simon Marchi
2019-11-25  5:27 ` [PATCH 06/15] Remove dict_empty/mdict_empty Simon Marchi
2019-11-25  5:27 ` [PATCH 05/15] Make a bunch of functions static Simon Marchi
2019-11-25  5:27 ` [PATCH 15/15] Enable -Wmissing-declarations diagnostic Simon Marchi
2019-11-25 22:06   ` Tom Tromey
2019-11-25 22:11     ` Simon Marchi
2019-11-26 14:12       ` Tom Tromey
2019-11-26 19:48         ` Simon Marchi
2019-11-25  5:27 ` [PATCH 03/15] Add missing includes in dwarf-index-write.c and mi/mi-interp.c Simon Marchi
2019-11-25  5:27 ` [PATCH 11/15] Remove declaration of tui_set_var_cmd, make definition static Simon Marchi
2019-11-25  5:33 ` [PATCH 08/15] Remove info_terminal_command declaration, " Simon Marchi
2019-11-25  5:33 ` [PATCH 14/15] Fix declaration of sparc_xfer_wcookie Simon Marchi
2019-11-25  5:33 ` [PATCH 10/15] Remove unused rbreak_command_wrapper and other declarations Simon Marchi
2019-11-25  5:33 ` [PATCH 09/15] Add declaration to python init func Simon Marchi
2019-11-25 22:08 ` [PATCH 00/15] Enable -Wmissing-declarations diagnostic Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f34cc19e-f4df-82eb-4e35-9132c9f84eea@FreeBSD.org \
    --to=jhb@freebsd.org \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox