All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Stefan Beller <sbeller@google.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/3] column: allow for custom printf
Date: Wed, 29 Mar 2017 23:12:32 -0400	[thread overview]
Message-ID: <20170330031232.cac2av5v5mk5bz7e@sigill.intra.peff.net> (raw)
In-Reply-To: <20170330014238.30032-3-sbeller@google.com>

On Wed, Mar 29, 2017 at 06:42:37PM -0700, Stefan Beller wrote:

> Signed-off-by: Stefan Beller <sbeller@google.com>

No justification?

I assume it will be used in a future patch.

> diff --git a/column.h b/column.h
> index 0a61917fa7..c44a1525a9 100644
> --- a/column.h
> +++ b/column.h
> @@ -24,6 +24,9 @@ struct column_options {
>  	int padding;
>  	const char *indent;
>  	const char *nl;
> +
> +	/* when non-NULL, use this printing function, fallback to printf */
> +	int (*_printf)(const char *__format, ...);
>  };

Avoid names with leading underscores. They're reserved by the C
standard.

I wonder if gcc is smart enough to let us mark this function pointer
with a "format" attribute so we can get compile-time checking of the
format string.

-Peff

  reply	other threads:[~2017-03-30  3:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30  1:42 [PATCH 0/3] Respect column.ui in commented status in git-commit Stefan Beller
2017-03-30  1:42 ` [PATCH 1/3] column.c: pass column_options to down to display_plain Stefan Beller
2017-03-30  1:42 ` [PATCH 2/3] column: allow for custom printf Stefan Beller
2017-03-30  3:12   ` Jeff King [this message]
2017-04-10 11:13   ` Duy Nguyen
2017-03-30  1:42 ` [PATCH 3/3] WIP - Allow custom printf function for column printing Stefan Beller
2017-03-30  3:22   ` Jeff King
2017-03-30 18:53     ` Stefan Beller
2017-04-10 11:35   ` Duy Nguyen

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=20170330031232.cac2av5v5mk5bz7e@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=sbeller@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.