From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <wqu@suse.com>
Cc: Josef Bacik <josef@toxicpanda.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs-progs: enable -Wmissing-prototypes for debug builds
Date: Tue, 2 May 2023 15:30:45 +0200 [thread overview]
Message-ID: <20230502133045.GD8111@suse.cz> (raw)
In-Reply-To: <f0af43f7-dd50-85aa-ff92-4bcac5d40ce5@suse.com>
On Tue, May 02, 2023 at 08:00:57PM +0800, Qu Wenruo wrote:
>
>
> On 2023/5/2 19:41, David Sterba wrote:
> > On Tue, May 02, 2023 at 09:29:30AM +0800, Qu Wenruo wrote:
> >> During development I'm a little surpirsed we don't have
> >> -Wmissing-prototypes enabled even for debug builds.
> >
> > The build supports W=levels like kernel and -Wmissing-prototypes is in
> > level 1. In some cases we may want to add the warnings to be on by
> > default for debugging builds though.
>
> I just did a quick search for the word "missing" of progs Makefile,
> unforunately no hit, thus I doubt if it's even in debug level 1.
>
> And the missing prototypes warning is by default enabled for kernel.
$ grep missing Makefile.extrawarn
warning-1 += -Wmissing-declarations
warning-1 += -Wmissing-format-attribute
warning-1 += $(call cc-option, -Wmissing-prototypes)
warning-1 += $(call cc-option, -Wmissing-include-dirs)
warning-1 += $(call cc-disable-warning, missing-field-initializers)
warning-2 += $(call cc-option, -Wmissing-field-initializers)
> [...]
> >>
> >> +#include "sha.h"
> >
> > This does not seem necessary, include whole file just for one prototype.
>
> This is necessary as we would define a global function, without
> including the header we got the missing prototype warning.
>
> All the other comments make sense and I would update the patchset.
>
>
> The only other concern is, would this extra warning causing more hassles
> for Josef to sync the kernel and progs code?
I don't know yet but it is possible that it would. In that case the separate
patch would make it easier to enable once all warnings are fixed, I can keep it
at the top of the branch.
next prev parent reply other threads:[~2023-05-02 13:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-02 1:29 [PATCH] btrfs-progs: enable -Wmissing-prototypes for debug builds Qu Wenruo
2023-05-02 9:30 ` Anand Jain
2023-05-02 11:41 ` David Sterba
2023-05-02 12:00 ` Qu Wenruo
2023-05-02 13:30 ` David Sterba [this message]
2023-05-02 14:25 ` Josef Bacik
2023-05-02 14:51 ` David Sterba
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=20230502133045.GD8111@suse.cz \
--to=dsterba@suse.cz \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=wqu@suse.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