git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: "Martin Ågren" <martin.agren@gmail.com>,
	"Git Mailing List" <git@vger.kernel.org>,
	"Taylor Blau" <me@ttaylorr.com>
Subject: Re: [PATCH] list-objects-filter-options: fix function name in BUG
Date: Tue, 17 Nov 2020 21:08:25 -0500	[thread overview]
Message-ID: <20201118020825.GF650959@coredump.intra.peff.net> (raw)
In-Reply-To: <CAPig+cQnA_zqtjOu2OryM57jVMQeo32U3iBYVzxFkPnZ9Zd+cA@mail.gmail.com>

On Tue, Nov 17, 2020 at 06:07:07PM -0500, Eric Sunshine wrote:

> On Tue, Nov 17, 2020 at 5:55 PM Jeff King <peff@peff.net> wrote:
> > I actually wonder if it is time to drop HAVE_VARIADIC_MACROS completely.
> > They are in C99, and we have been introducing many other C99-isms. It
> > would be a minor cleanup to a few bits of code, which perhaps isn't
> > worth the risk. But I also have a vague memory of not being able to
> > implement some interfaces because we couldn't count on them.
> >
> > Poking around, 3689539127 (add helpers for allocating flex-array
> > structs, 2016-02-22) points out one such case. I think discussion of
> > BUG_ON() got blocked by that, too. Looks like we also discussed them in
> > the big "C99 weather balloon" thread:
> 
> There was also an idea[1] to use variadic macros to prevent `errno`
> from being clobbered in a case like this:
> 
>     die_errno(_("blah %s"), foobar());
> 
> In which, if foobar() changes `errno`, then die_errno() reports the wrong value.
> 
> [1]: https://lore.kernel.org/git/CAPig+cQKMxwadf9aGyC5ESa-vxDy9PzrYo+m+JaVQ3S=12PyQQ@mail.gmail.com/

Thanks, that's another good example. This _could_ be done conditionally
on HAVE_VARIADIC_MACROS, but it would mean on the non-variadic platform
that they'd see the wrong errno. I'm willing to give them worse BUG()
messages, but that may be going too far. :)

I still suspect there may be zero such platforms, which would mean
nobody is affected. But if that is the case, then we should just say so
and get rid of the HAVE_VARIADIC_MACROS flag entirely.

-Peff

  reply	other threads:[~2020-11-18  2:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-14  8:43 [PATCH] list-objects-filter-options: fix function name in BUG Martin Ågren
2020-11-17  2:13 ` Jeff King
2020-11-17 18:02   ` Martin Ågren
2020-11-17 22:54     ` Jeff King
2020-11-17 23:07       ` Eric Sunshine
2020-11-18  2:08         ` Jeff King [this message]
2020-11-18  2:24       ` Jonathan Nieder
2020-11-18  6:22       ` Martin Ågren

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20201118020825.GF650959@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=martin.agren@gmail.com \
    --cc=me@ttaylorr.com \
    --cc=sunshine@sunshineco.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).