git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Beat Bolli <dev+git@drbeat.li>
Cc: git@vger.kernel.org
Subject: Re: [RFC PATCH 4/6] sequencer.c: avoid empty statements at top level
Date: Mon, 09 Jul 2018 14:34:05 -0700	[thread overview]
Message-ID: <xmqqo9fgayb6.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20180708144342.11922-5-dev+git@drbeat.li> (Beat Bolli's message of "Sun, 8 Jul 2018 16:43:40 +0200")

Beat Bolli <dev+git@drbeat.li> writes:

> The marco GIT_PATH_FUNC expands to a complete statement including the
> semicolon. Remove two extra trailing semicolons.

Wait a bit.  The observation in the log message and the
implementation of GIT_PATH_FUNC() do not match.

        #define GIT_PATH_FUNC(func, filename) \
                const char *func(void) \
                { \
                        static char *ret; \
                        if (!ret) \
                                ret = git_pathdup(filename); \
                        return ret; \
                }

The code generated does "include semicolon" but that is not why the
caller should place semicolon after the closing parens.  Perhaps
replace "including the semicolon." with something else, like ", and
adding a semicolon after it not only is unnecessary but is wrong."
or soemthing like that?

It is a bit unfortunate that we need to live with a slight uglyness
of the resulting source code, unlike e.g. define_commit_slab() that
can (and must) end with a semicolon, which gives us a more natural
look.  But that is a separate issue.

>
> Signed-off-by: Beat Bolli <dev+git@drbeat.li>
> ---
>  sequencer.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sequencer.c b/sequencer.c
> index 5354d4d51e..66e7073995 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -62,12 +62,12 @@ static GIT_PATH_FUNC(rebase_path_done, "rebase-merge/done")
>   * The file to keep track of how many commands were already processed (e.g.
>   * for the prompt).
>   */
> -static GIT_PATH_FUNC(rebase_path_msgnum, "rebase-merge/msgnum");
> +static GIT_PATH_FUNC(rebase_path_msgnum, "rebase-merge/msgnum")
>  /*
>   * The file to keep track of how many commands are to be processed in total
>   * (e.g. for the prompt).
>   */
> -static GIT_PATH_FUNC(rebase_path_msgtotal, "rebase-merge/end");
> +static GIT_PATH_FUNC(rebase_path_msgtotal, "rebase-merge/end")
>  /*
>   * The commit message that is planned to be used for any changes that
>   * need to be committed following a user interaction.

  parent reply	other threads:[~2018-07-09 21:34 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-08 14:43 [RFC PATCH 0/6] Compile cleanly in pedantic mode Beat Bolli
2018-07-08 14:43 ` [RFC PATCH 1/6] connect.h: avoid forward declaration of an enum Beat Bolli
2018-07-08 14:43 ` [RFC PATCH 2/6] refs/refs-internal.h: " Beat Bolli
2018-07-09 18:46   ` Jeff King
2018-07-09 19:30     ` Beat Bolli
2018-07-10  2:15       ` Jeff King
2018-07-08 14:43 ` [RFC PATCH 3/6] convert.c: replace "\e" escapes with "\033" Beat Bolli
2018-07-08 14:43 ` [RFC PATCH 4/6] sequencer.c: avoid empty statements at top level Beat Bolli
2018-07-08 20:54   ` Eric Sunshine
2018-07-08 21:17     ` Philip Oakley
2018-07-09  9:37       ` ig
2018-07-09 21:34   ` Junio C Hamano [this message]
2018-07-09 21:37     ` Beat Bolli
2018-07-08 14:43 ` [RFC PATCH 5/6] string-list.c: avoid conversion from void * to function pointer Beat Bolli
2018-07-08 14:43 ` [RFC PATCH 6/6] utf8.c: avoid char overflow Beat Bolli
2018-07-09 13:14   ` Johannes Schindelin
2018-07-09 14:48     ` Beat Bolli
2018-07-09 15:45       ` Beat Bolli
2018-07-09 16:33       ` Junio C Hamano
2018-07-09 17:56         ` Beat Bolli
2018-07-09 18:18         ` Junio C Hamano
2018-07-09 20:04       ` Johannes Schindelin
2018-07-09 13:40 ` [RFC PATCH 0/6] Compile cleanly in pedantic mode Johannes Schindelin
2018-07-09 16:25 ` Junio C Hamano
2018-07-09 19:25 ` [PATCH " Beat Bolli
2018-07-09 20:25   ` Beat Bolli
2018-07-09 21:45   ` Junio C Hamano
2018-07-09 21:47     ` Beat Bolli
2018-07-10  7:34     ` Beat Bolli
2018-07-11 15:42       ` Junio C Hamano
2018-07-12 13:25         ` Johannes Schindelin
2018-07-12 15:40           ` Junio C Hamano
2018-07-09 19:25 ` [PATCH 1/6] connect.h: avoid forward declaration of an enum Beat Bolli
2018-07-09 19:25 ` [PATCH 2/6] refs/refs-internal.h: " Beat Bolli
2018-07-09 19:25 ` [PATCH 3/6] convert.c: replace "\e" escapes with "\033" Beat Bolli
2018-07-09 19:25 ` [PATCH 4/6] sequencer.c: avoid empty statements at top level Beat Bolli
2018-07-09 21:37   ` Junio C Hamano
2018-07-09 19:25 ` [PATCH 5/6] string-list.c: avoid conversion from void * to function pointer Beat Bolli
2018-07-09 19:25 ` [PATCH 6/6] utf8.c: avoid char overflow Beat Bolli

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=xmqqo9fgayb6.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=dev+git@drbeat.li \
    --cc=git@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.
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).