From: "Shawn O. Pearce" <spearce@spearce.org>
To: Miklos Vajna <vmiklos@frugalware.org>
Cc: Jeff King <peff@peff.net>, git@vger.kernel.org
Subject: Re: [PATCH] git branch -D: give a better error message when lockfile creation fails
Date: Sat, 26 Sep 2009 12:58:12 -0700 [thread overview]
Message-ID: <20090926195812.GH14660@spearce.org> (raw)
In-Reply-To: <1253972051-31980-1-git-send-email-vmiklos@frugalware.org>
Miklos Vajna <vmiklos@frugalware.org> wrote:
> On Fri, Sep 25, 2009 at 11:31:43PM -0400, Jeff King <peff@peff.net> wrote:
> > afterwards). So probably you would need to first refactor
> > unable_to_lock_index_die() to handle just printing the error without
> > dying.
>
> I removed the NORETURN macro as otherwise gcc would issue a warning, as
> it does not realise that unable_to_lock_index_die() never returns.
Please don't. If you refactor the error message formatting into
a static function called from the two extern ones, you can still
centralize the formatting but also keep NORETURN on the method that
doesn't return. The annotation is useful and should not be removed.
> -extern NORETURN void unable_to_lock_index_die(const char *path, int err);
> +extern int unable_to_lock_index(const char *path, int err, int noreturn);
> +extern void unable_to_lock_index_die(const char *path, int err);
--
Shawn.
next prev parent reply other threads:[~2009-09-26 19:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-26 0:06 [PATCH] git branch -D: give a better error message when lockfile creation fails Miklos Vajna
2009-09-26 3:31 ` Jeff King
2009-09-26 13:34 ` Miklos Vajna
2009-09-26 19:58 ` Shawn O. Pearce [this message]
2009-09-26 20:04 ` Matthieu Moy
2009-09-26 23:15 ` Miklos Vajna
2009-09-27 8:21 ` Jeff King
2009-09-27 8:49 ` Miklos Vajna
2009-09-26 20:12 ` Matthieu Moy
-- strict thread matches above, loose matches on Subject: below --
2009-09-25 23:53 Miklos Vajna
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=20090926195812.GH14660@spearce.org \
--to=spearce@spearce.org \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=vmiklos@frugalware.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;
as well as URLs for NNTP newsgroup(s).