mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <>
To: "Ævar Arnfjörð Bjarmason" <>
Cc: Beat Bolli <>,
Subject: Re: [PATCH] Makefile: add a DEVOPTS flag to get pedantic compilation
Date: Mon, 23 Jul 2018 11:51:54 -0700	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <> (=?utf-8?B?IsOGdmFyIEFy?= =?utf-8?B?bmZqw7Zyw7A=?= Bjarmason"'s message of "Sat, 21 Jul 2018 21:41:32 +0200")

Ævar Arnfjörð Bjarmason <> writes:

>> +CFLAGS += -pedantic
>> +# don't warn for each N_ use
>> +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.

The Make variable USE_PARENS_AROUND_GETTEXT_N is described as taking
"yes" or "no".

    # Define USE_PARENS_AROUND_GETTEXT_N to "yes" if your compiler happily
    # compiles the following initialization:
    #   static const char s[] = ("FOO");
    # and define it to "no" if you need to remove the parentheses () around the
    # constant.  The default is "auto", which means to use parentheses if your
    # compiler is detected to support it.

But the knob on the CFLAGS set by these variables take 1 or 0


And the code that uses the CFLAGS knob 

    /* Mark msgid for translation but do not translate it. */
    #define N_(msgid) msgid
    #define N_(msgid) (msgid)

pays attention to the truth/false in usual C preprocessor sense.
Your "no" happens to serve as 0 just like "yes" would.

So I think you suggestion is a bad one that makes a misleading


*1* The following shows all "not X" except for "not one".

#include <stdio.h>

#define ZERO 0
#define ONE 1
#define YES yes
#define NO no
#undef UNDEF

const char *msgs[] = {
#if !ZERO
	"not zero",
#if !ONE
	"not one",
#if !YES
	"not yes",
#if !NO
	"not no",
#if !UNDEF
	"not undef",

int main(int ac, char **av)
	const char **cp = msgs;

	while (*cp) {
		printf("%s\n", *cp);
	return 0;

      reply	other threads:[~2018-07-23 18:51 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
2018-07-23 18:51   ` Junio C Hamano [this message]

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:

  List information:

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

  git send-email \ \ \ \ \ \

* 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

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).