On Tue, Jan 24, 2017 at 01:52:13PM -0800, Junio C Hamano wrote:
> > I dunno. As ugly as the "%s" thing is in the source, at least it doesn't
> > change the output. Not that an extra space is the end of the world, but
> > it seems like it's letting the problem escape from the source code.
> >
> > Do people still care about resolving this? -Wno-format-zero-length is in
> > the DEVELOPER options. It wasn't clear to me if that was sufficient, or
> > if we're going to get a bunch of reports from people that need to be
> > directed to the right compiler options.
>
> I view both as ugly, but probably "%s", "" is lessor of the two
> evils.
>
> Perhaps
>
> #define JUST_SHOW_EMPTY_LINE "%s", ""
>
> ...
> warning(JUST_SHOW_EMPTY_LINE);
> ...
>
> or something silly like that?
Gross, but at least it's self documenting. :)
I guess a less horrible version of that is:
static inline warning_blank_line(void)
{
warning("%s", "");
}
We'd potentially need a matching one for error(), but at last it avoids
macro trickery.
-Peff