git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Beat Bolli <dev+git@drbeat.li>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH] Makefile: add a DEVOPTS flag to get pedantic compilation
Date: Sat, 21 Jul 2018 21:41:32 +0200	[thread overview]
Message-ID: <87wotobclv.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <20180721185933.32377-1-dev+git@drbeat.li>


On Sat, Jul 21 2018, Beat Bolli wrote:

> In the interest of code hygiene, make it easier to compile Git with the
> flag -pedantic.
>
> Pure pedantic compilation results in one warning per use of the
> translation macro `N_`, therefore also disable the parenthesising of
> i18n strings with -DUSE_PARENS_AROUND_GETTEXT_N=0 to show only real
> warnings.

I like this...

> diff --git a/Makefile b/Makefile
> index 0cb6590f24..f800054379 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -484,6 +484,10 @@ all::
>  #        The DEVELOPER mode enables -Wextra with a few exceptions. By
>  #        setting this flag the exceptions are removed, and all of
>  #        -Wextra is used.
> +#
> +#    pedantic:
> +#
> +#        Enable -pedantic compilation.

But let's mention that we toggle USE_PARENS_AROUND_GETTEXT_N implicitly
when this is set here.

> +CFLAGS += -pedantic
> +# don't warn for each N_ use
> +CFLAGS += -DUSE_PARENS_AROUND_GETTEXT_N=0
> +endif

...and set this to "no" not "0" since we document that that's the way to
toggle it off in the Makefile, i.e. let's be consistent.

Also, it would be helpful for future digging if the commit message
mentioned which -W flag included in -Wpedantic is triggering this
USE_PARENS_AROUND_GETTEXT_N condition that previously wasn't triggered,
and on which compiler & version. 290c8e7a3f ("gettext.h: add parentheses
around N_ expansion if supported", 2015-01-11) doesn't mention anything
like that.

  reply	other threads:[~2018-07-21 19:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-21 18:59 [PATCH] Makefile: add a DEVOPTS flag to get pedantic compilation Beat Bolli
2018-07-21 19:41 ` Ævar Arnfjörð Bjarmason [this message]
2018-07-23 18:51   ` Junio C Hamano

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=87wotobclv.fsf@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=dev+git@drbeat.li \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).