public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Carlos Maiolino <cem@kernel.org>
Cc: Christoph Hellwig <hch@infradead.org>, xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH v2] xfs_repair: detect null buf passed to duration
Date: Mon, 3 Jun 2024 09:14:46 -0700	[thread overview]
Message-ID: <20240603161446.GA52987@frogsfrogsfrogs> (raw)
In-Reply-To: <myn5kmvijvegbg5k2i2rvt3ioawnm4bzyls6fn42bvufr4x664@ovy7iysu7pjk>

On Mon, Jun 03, 2024 at 02:42:20PM +0200, Carlos Maiolino wrote:
> 
> > diff --git a/repair/progress.h b/repair/progress.h
> > index 0b06b2c4f43f..c09aa69413ac 100644
> > --- a/repair/progress.h
> > +++ b/repair/progress.h
> > @@ -38,7 +38,7 @@ extern void summary_report(void);
> >  extern int  set_progress_msg(int report, uint64_t total);
> >  extern uint64_t print_final_rpt(void);
> >  extern char *timestamp(struct xfs_mount *mp, int end, int phase, char *buf);
> > -extern char *duration(time_t val, char *buf);
> > +char *duration(time_t val, char *buf) __attribute__((nonnull(2)));
> 
> Once nonnull() is used here, shouldn't we also set -Wnonnull to CFLAGS?

Already set via -Wall, at least if you're using gcc 12.2:

       -Wnonnull
           Warn about passing a null pointer for arguments marked as
           requiring a non-null value by the "nonnull" function
           attribute.

           -Wnonnull is included in -Wall and -Wformat.  It can be
           disabled with the -Wno-nonnull option.

https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/tree/include/builddefs.in?h=for-next#n113

> Please don't take it as a review, it's just a question that came to my mind as I don't fully
> understand the implications of using nonnull here.

<nod>

--D

> Carlos
> 

  reply	other threads:[~2024-06-03 16:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-31 20:10 [PATCH] xfs_repair: detect null buf passed to duration Darrick J. Wong
2024-06-01  5:00 ` Christoph Hellwig
2024-06-01 17:58   ` Darrick J. Wong
2024-06-01 17:58 ` [PATCH v2] " Darrick J. Wong
2024-06-03 12:42   ` Carlos Maiolino
2024-06-03 16:14     ` Darrick J. Wong [this message]
2024-06-05 14:17       ` Carlos Maiolino
2024-06-04  4:09   ` Christoph Hellwig

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=20240603161446.GA52987@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=cem@kernel.org \
    --cc=hch@infradead.org \
    --cc=linux-xfs@vger.kernel.org \
    /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