{"thread":{"id":"48934","subject":"[PATCH v2] Makefile: add a DEVOPTS flag to get pedantic compilation","startedAt":"2018-07-21T20:37:06Z","lastAt":"2018-07-25T17:38:48Z","messageCount":8,"participants":["Beat Bolli","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"353255","messageId":"20180721203647.2619-1-dev+git@drbeat.li","threadId":"48934","inReplyTo":null,"subject":"[PATCH v2] Makefile: add a DEVOPTS flag to get pedantic compilation","fromName":"Beat Bolli","fromEmail":"dev+git@drbeat.li","sentAt":"2018-07-21T20:36:47Z","receivedAt":"2018-07-21T20:37:06Z","isPatch":true,"sender":{"key":"dev+git@drbeat.li","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"In the interest of code hygiene, make it easier to compile Git with the\nflag -pedantic.\n\nPure pedantic compilation with GCC 7.3 results in one warning per use of\nthe translation macro `N_`:\n\n    warning: array initialized from parenthesized string constant [-Wpedantic]\n\nTherefore also disable the parenthesising of i18n strings with\n-DUSE_PARENS_AROUND_GETTEXT_N=no.\n\nSigned-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n\nThis is the convenience knob for all developers that led to the series\nbb/pedantic[1]. It does not depend on this series, though.\n\n[1] https://public-inbox.org/git/20180708144342.11922-1-dev+git@drbeat.li/T/#u\n\n Makefile       | 6 ++++++\n config.mak.dev | 5 +++++\n 2 files changed, 11 insertions(+)\n\ndiff --git a/Makefile b/Makefile\nindex 0cb6590f24..2bfc051652 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -484,6 +484,12 @@ all::\n #        The DEVELOPER mode enables -Wextra with a few exceptions. By\n #        setting this flag the exceptions are removed, and all of\n #        -Wextra is used.\n+#\n+#    pedantic:\n+#\n+#        Enable -pedantic compilation. This also disables\n+#        USE_PARENS_AROUND_GETTEXT_N to produce only relevant warnings.\n \n GIT-VERSION-FILE: FORCE\n \t@$(SHELL_PATH) ./GIT-VERSION-GEN\ndiff --git a/config.mak.dev b/config.mak.dev\nindex 2d244ca470..e11dd94741 100644\n--- a/config.mak.dev\n+++ b/config.mak.dev\n@@ -1,6 +1,11 @@\n ifeq ($(filter no-error,$(DEVOPTS)),)\n CFLAGS += -Werror\n endif\n+ifneq ($(filter pedantic,$(DEVOPTS)),)\n+CFLAGS += -pedantic\n+# don't warn for each N_ use\n+CFLAGS += -DUSE_PARENS_AROUND_GETTEXT_N=no\n+endif\n CFLAGS += -Wdeclaration-after-statement\n CFLAGS += -Wno-format-zero-length\n CFLAGS += -Wold-style-definition\n-- \n2.18.0.203.gfac676dfb9\n\n"},{"id":"353399","messageId":"xmqqva956ax8.fsf@gitster-ct.c.googlers.com","threadId":"48934","inReplyTo":"20180721203647.2619-1-dev+git@drbeat.li","subject":"Re: [PATCH v2] Makefile: add a DEVOPTS flag to get pedantic compilation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-07-23T18:53:39Z","receivedAt":"2018-07-23T18:53:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Beat Bolli <dev+git@drbeat.li> writes:\n\n> In the interest of code hygiene, make it easier to compile Git with the\n> flag -pedantic.\n>\n> Pure pedantic compilation with GCC 7.3 results in one warning per use of\n> the translation macro `N_`:\n>\n>     warning: array initialized from parenthesized string constant [-Wpedantic]\n>\n> Therefore also disable the parenthesising of i18n strings with\n> -DUSE_PARENS_AROUND_GETTEXT_N=no.\n>\n> Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n> ---\n>\n> This is the convenience knob for all developers that led to the series\n> bb/pedantic[1]. It does not depend on this series, though.\n\nYup, but \"make DEVELOPER=Yes\" build won't pass unless this patch is\nqueued after those clean-up ;-)\n\nRemind me if I forget to tweak =no back to =0 before pushing the\nresult out.\n\nThanks.\n\n> [1] https://public-inbox.org/git/20180708144342.11922-1-dev+git@drbeat.li/T/#u\n>\n>  Makefile       | 6 ++++++\n>  config.mak.dev | 5 +++++\n>  2 files changed, 11 insertions(+)\n>\n> diff --git a/Makefile b/Makefile\n> index 0cb6590f24..2bfc051652 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -484,6 +484,12 @@ all::\n>  #        The DEVELOPER mode enables -Wextra with a few exceptions. By\n>  #        setting this flag the exceptions are removed, and all of\n>  #        -Wextra is used.\n> +#\n> +#    pedantic:\n> +#\n> +#        Enable -pedantic compilation. This also disables\n> +#        USE_PARENS_AROUND_GETTEXT_N to produce only relevant warnings.\n>  \n>  GIT-VERSION-FILE: FORCE\n>  \t@$(SHELL_PATH) ./GIT-VERSION-GEN\n> diff --git a/config.mak.dev b/config.mak.dev\n> index 2d244ca470..e11dd94741 100644\n> --- a/config.mak.dev\n> +++ b/config.mak.dev\n> @@ -1,6 +1,11 @@\n>  ifeq ($(filter no-error,$(DEVOPTS)),)\n>  CFLAGS += -Werror\n>  endif\n> +ifneq ($(filter pedantic,$(DEVOPTS)),)\n> +CFLAGS += -pedantic\n> +# don't warn for each N_ use\n> +CFLAGS += -DUSE_PARENS_AROUND_GETTEXT_N=no\n> +endif\n>  CFLAGS += -Wdeclaration-after-statement\n>  CFLAGS += -Wno-format-zero-length\n>  CFLAGS += -Wold-style-definition\n"},{"id":"353444","messageId":"7666172f-3113-109c-29cf-f1598195b100@drbeat.li","threadId":"48934","inReplyTo":"xmqqva956ax8.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH v2] Makefile: add a DEVOPTS flag to get pedantic compilation","fromName":"Beat Bolli","fromEmail":"dev+git@drbeat.li","sentAt":"2018-07-24T06:04:23Z","receivedAt":"2018-07-24T06:04:37Z","isPatch":true,"sender":{"key":"dev+git@drbeat.li","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"On 23.07.18 20:53, Junio C Hamano wrote:\n> Beat Bolli <dev+git@drbeat.li> writes:\n> \n>> In the interest of code hygiene, make it easier to compile Git with the\n>> flag -pedantic.\n>>\n>> Pure pedantic compilation with GCC 7.3 results in one warning per use of\n>> the translation macro `N_`:\n>>\n>>     warning: array initialized from parenthesized string constant [-Wpedantic]\n>>\n>> Therefore also disable the parenthesising of i18n strings with\n>> -DUSE_PARENS_AROUND_GETTEXT_N=no.\n>>\n>> Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n>> ---\n>>\n>> This is the convenience knob for all developers that led to the series\n>> bb/pedantic[1]. It does not depend on this series, though.\n> \n> Yup, but \"make DEVELOPER=Yes\" build won't pass unless this patch is\n> queued after those clean-up ;-)\n\nThen there's a bug in this patch. It should only have an effect if we\n\"make DEVELOPER=Yes DEVOPTS=pedantic\". Did you try this?\n\n> Remind me if I forget to tweak =no back to =0 before pushing the\n> result out.\n\nNo problem, I can send a v3 with this change reverted.\n\nBeat\n\n> \n> Thanks.\n> \n>> [1] https://public-inbox.org/git/20180708144342.11922-1-dev+git@drbeat.li/T/#u\n>>\n>>  Makefile       | 6 ++++++\n>>  config.mak.dev | 5 +++++\n>>  2 files changed, 11 insertions(+)\n>>\n>> diff --git a/Makefile b/Makefile\n>> index 0cb6590f24..2bfc051652 100644\n>> --- a/Makefile\n>> +++ b/Makefile\n>> @@ -484,6 +484,12 @@ all::\n>>  #        The DEVELOPER mode enables -Wextra with a few exceptions. By\n>>  #        setting this flag the exceptions are removed, and all of\n>>  #        -Wextra is used.\n>> +#\n>> +#    pedantic:\n>> +#\n>> +#        Enable -pedantic compilation. This also disables\n>> +#        USE_PARENS_AROUND_GETTEXT_N to produce only relevant warnings.\n>>  \n>>  GIT-VERSION-FILE: FORCE\n>>  \t@$(SHELL_PATH) ./GIT-VERSION-GEN\n>> diff --git a/config.mak.dev b/config.mak.dev\n>> index 2d244ca470..e11dd94741 100644\n>> --- a/config.mak.dev\n>> +++ b/config.mak.dev\n>> @@ -1,6 +1,11 @@\n>>  ifeq ($(filter no-error,$(DEVOPTS)),)\n>>  CFLAGS += -Werror\n>>  endif\n>> +ifneq ($(filter pedantic,$(DEVOPTS)),)\n>> +CFLAGS += -pedantic\n>> +# don't warn for each N_ use\n>> +CFLAGS += -DUSE_PARENS_AROUND_GETTEXT_N=no\n>> +endif\n>>  CFLAGS += -Wdeclaration-after-statement\n>>  CFLAGS += -Wno-format-zero-length\n>>  CFLAGS += -Wold-style-definition\n\n"},{"id":"353463","messageId":"xmqqa7qg22he.fsf@gitster-ct.c.googlers.com","threadId":"48934","inReplyTo":"7666172f-3113-109c-29cf-f1598195b100@drbeat.li","subject":"Re: [PATCH v2] Makefile: add a DEVOPTS flag to get pedantic compilation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-07-24T13:21:49Z","receivedAt":"2018-07-24T13:21:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Beat Bolli <dev+git@drbeat.li> writes:\n\n> On 23.07.18 20:53, Junio C Hamano wrote:\n>> \n>>> This is the convenience knob for all developers that led to the series\n>>> bb/pedantic[1]. It does not depend on this series, though.\n>> \n>> Yup, but \"make DEVELOPER=Yes\" build won't pass unless this patch is\n>> queued after those clean-up ;-)\n>\n> Then there's a bug in this patch. It should only have an effect if we\n> \"make DEVELOPER=Yes DEVOPTS=pedantic\". Did you try this?\n\nSorry, \"exercising the feature\" is what I meant to say with that\n\"make\" invocation, so I should have also spelled DEVOPTS bit, too.\n"},{"id":"353494","messageId":"20180724171339.18983-1-dev+git@drbeat.li","threadId":"48934","inReplyTo":"xmqqa7qg22he.fsf@gitster-ct.c.googlers.com","subject":"[PATCH v3] Makefile: add a DEVOPTS flag to get pedantic compilation","fromName":"Beat Bolli","fromEmail":"dev+git@drbeat.li","sentAt":"2018-07-24T17:13:39Z","receivedAt":"2018-07-24T17:14:02Z","isPatch":true,"sender":{"key":"dev+git@drbeat.li","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"In the interest of code hygiene, make it easier to compile Git with the\nflag -pedantic.\n\nPure pedantic compilation with GCC 7.3 results in one warning per use of\nthe translation macro `N_`:\n\n    warning: array initialized from parenthesized string constant [-Wpedantic]\n\nTherefore also disable the parenthesising of i18n strings with\n-DUSE_PARENS_AROUND_GETTEXT_N=no.\n\nSigned-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n\nNow with -DUSE_PARENS_AROUND_GETTEXT_N=0 instead of =No.\n\nThis is the convenience knob for all developers that led to the series\nbb/pedantic[1]. It does not depend on this series, though.\n\n[1] https://public-inbox.org/git/20180708144342.11922-1-dev+git@drbeat.li/T/#u\n\n Makefile       | 6 ++++++\n config.mak.dev | 5 +++++\n 2 files changed, 11 insertions(+)\n\ndiff --git a/Makefile b/Makefile\nindex 0cb6590f24..2bfc051652 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -484,6 +484,12 @@ all::\n #        The DEVELOPER mode enables -Wextra with a few exceptions. By\n #        setting this flag the exceptions are removed, and all of\n #        -Wextra is used.\n+#\n+#    pedantic:\n+#\n+#        Enable -pedantic compilation. This also disables\n+#        USE_PARENS_AROUND_GETTEXT_N to produce only relevant warnings.\n \n GIT-VERSION-FILE: FORCE\n \t@$(SHELL_PATH) ./GIT-VERSION-GEN\ndiff --git a/config.mak.dev b/config.mak.dev\nindex 2d244ca470..e11dd94741 100644\n--- a/config.mak.dev\n+++ b/config.mak.dev\n@@ -1,6 +1,11 @@\n ifeq ($(filter no-error,$(DEVOPTS)),)\n CFLAGS += -Werror\n endif\n+ifneq ($(filter pedantic,$(DEVOPTS)),)\n+CFLAGS += -pedantic\n+# don't warn for each N_ use\n+CFLAGS += -DUSE_PARENS_AROUND_GETTEXT_N=0\n+endif\n CFLAGS += -Wdeclaration-after-statement\n CFLAGS += -Wno-format-zero-length\n CFLAGS += -Wold-style-definition\n-- \n2.18.0.203.gfac676dfb9\n\n"},{"id":"353515","messageId":"20180724192643.21505-1-dev+git@drbeat.li","threadId":"48934","inReplyTo":"20180724171339.18983-1-dev+git@drbeat.li","subject":"[PATCH v4] Makefile: add a DEVOPTS flag to get pedantic compilation","fromName":"Beat Bolli","fromEmail":"dev+git@drbeat.li","sentAt":"2018-07-24T19:26:43Z","receivedAt":"2018-07-24T19:26:58Z","isPatch":true,"sender":{"key":"dev+git@drbeat.li","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"In the interest of code hygiene, make it easier to compile Git with the\nflag -pedantic.\n\nPure pedantic compilation with GCC 7.3 results in one warning per use of\nthe translation macro `N_`:\n\n    warning: array initialized from parenthesized string constant [-Wpedantic]\n\nTherefore also disable the parenthesising of i18n strings with\n-DUSE_PARENS_AROUND_GETTEXT_N=0.\n\nSigned-off-by: Beat Bolli <dev+git@drbeat.li>\n---\n\nNow with -DUSE_PARENS_AROUND_GETTEXT_N=0 instead of =No.\n\nThis is the convenience knob for all developers that led to the series\nbb/pedantic[1]. It does not depend on this series, though.\n\n[1] https://public-inbox.org/git/20180708144342.11922-1-dev+git@drbeat.li/T/#u\n\n Makefile       | 6 ++++++\n config.mak.dev | 5 +++++\n 2 files changed, 11 insertions(+)\n\ndiff --git a/Makefile b/Makefile\nindex 0cb6590f24..2bfc051652 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -484,6 +484,12 @@ all::\n #        The DEVELOPER mode enables -Wextra with a few exceptions. By\n #        setting this flag the exceptions are removed, and all of\n #        -Wextra is used.\n+#\n+#    pedantic:\n+#\n+#        Enable -pedantic compilation. This also disables\n+#        USE_PARENS_AROUND_GETTEXT_N to produce only relevant warnings.\n \n GIT-VERSION-FILE: FORCE\n \t@$(SHELL_PATH) ./GIT-VERSION-GEN\ndiff --git a/config.mak.dev b/config.mak.dev\nindex 2d244ca470..e11dd94741 100644\n--- a/config.mak.dev\n+++ b/config.mak.dev\n@@ -1,6 +1,11 @@\n ifeq ($(filter no-error,$(DEVOPTS)),)\n CFLAGS += -Werror\n endif\n+ifneq ($(filter pedantic,$(DEVOPTS)),)\n+CFLAGS += -pedantic\n+# don't warn for each N_ use\n+CFLAGS += -DUSE_PARENS_AROUND_GETTEXT_N=0\n+endif\n CFLAGS += -Wdeclaration-after-statement\n CFLAGS += -Wno-format-zero-length\n CFLAGS += -Wold-style-definition\n-- \n2.18.0.203.gfac676dfb9\n\n"},{"id":"353572","messageId":"xmqqzhyfuub6.fsf@gitster-ct.c.googlers.com","threadId":"48934","inReplyTo":"20180724192643.21505-1-dev+git@drbeat.li","subject":"Re: [PATCH v4] Makefile: add a DEVOPTS flag to get pedantic compilation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-07-25T16:57:49Z","receivedAt":"2018-07-25T16:57:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Beat Bolli <dev+git@drbeat.li> writes:\n\n> In the interest of code hygiene, make it easier to compile Git with the\n> flag -pedantic.\n>\n> Pure pedantic compilation with GCC 7.3 results in one warning per use of\n> the translation macro `N_`:\n>\n>     warning: array initialized from parenthesized string constant [-Wpedantic]\n>\n> Therefore also disable the parenthesising of i18n strings with\n> -DUSE_PARENS_AROUND_GETTEXT_N=0.\n>\n> Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n> ---\n\nHmph, what did you change between v3 and v4?\n\n> diff --git a/Makefile b/Makefile\n> index 0cb6590f24..2bfc051652 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -484,6 +484,12 @@ all::\n\nThe postimage of this hunk is supposed to be 11 lines long, as you\nhave five additional line in the middle of 6 original context lines.\nWhere did this 12 come from?  I am only interested in finding out if\nour patch generation tool(s) have some bugs with this question.\n\nIf this is only because you hand-edit your patch, then we have no\ntool breakage to worry about, but please refrain from doing so in\nthe future (instead always go back to the commit, amend it, and\nre-run format-patch).\n\nThanks.\n\n>  #        The DEVELOPER mode enables -Wextra with a few exceptions. By\n>  #        setting this flag the exceptions are removed, and all of\n>  #        -Wextra is used.\n> +#\n> +#    pedantic:\n> +#\n> +#        Enable -pedantic compilation. This also disables\n> +#        USE_PARENS_AROUND_GETTEXT_N to produce only relevant warnings.\n>  \n>  GIT-VERSION-FILE: FORCE\n>  \t@$(SHELL_PATH) ./GIT-VERSION-GEN\n"},{"id":"353575","messageId":"504f6cfe-f869-97f6-248d-642ae1e6dfc0@drbeat.li","threadId":"48934","inReplyTo":"xmqqzhyfuub6.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH v4] Makefile: add a DEVOPTS flag to get pedantic compilation","fromName":"Beat Bolli","fromEmail":"dev+git@drbeat.li","sentAt":"2018-07-25T17:38:37Z","receivedAt":"2018-07-25T17:38:48Z","isPatch":true,"sender":{"key":"dev+git@drbeat.li","avatar":"https://avatars.githubusercontent.com/u/21444?v=4"},"body":"On 25.07.18 18:57, Junio C Hamano wrote:\n> Beat Bolli <dev+git@drbeat.li> writes:\n> \n>> In the interest of code hygiene, make it easier to compile Git with the\n>> flag -pedantic.\n>>\n>> Pure pedantic compilation with GCC 7.3 results in one warning per use of\n>> the translation macro `N_`:\n>>\n>>     warning: array initialized from parenthesized string constant [-Wpedantic]\n>>\n>> Therefore also disable the parenthesising of i18n strings with\n>> -DUSE_PARENS_AROUND_GETTEXT_N=0.\n>>\n>> Signed-off-by: Beat Bolli <dev+git@drbeat.li>\n>> ---\n> \n> Hmph, what did you change between v3 and v4?\n\nJust the commit text. In v3, it still said =No instead of =0.\n\n>> diff --git a/Makefile b/Makefile\n>> index 0cb6590f24..2bfc051652 100644\n>> --- a/Makefile\n>> +++ b/Makefile\n>> @@ -484,6 +484,12 @@ all::\n> \n> The postimage of this hunk is supposed to be 11 lines long, as you\n> have five additional line in the middle of 6 original context lines.\n> Where did this 12 come from?  I am only interested in finding out if\n> our patch generation tool(s) have some bugs with this question.\n> \n> If this is only because you hand-edit your patch, then we have no\n> tool breakage to worry about, but please refrain from doing so in\n> the future (instead always go back to the commit, amend it, and\n> re-run format-patch).\n> \n> Thanks.\n\nYou got me there :-/\n\nWon't happen again, sorry.\n\n>>  #        The DEVELOPER mode enables -Wextra with a few exceptions. By\n>>  #        setting this flag the exceptions are removed, and all of\n>>  #        -Wextra is used.\n>> +#\n>> +#    pedantic:\n>> +#\n>> +#        Enable -pedantic compilation. This also disables\n>> +#        USE_PARENS_AROUND_GETTEXT_N to produce only relevant warnings.\n>>  \n>>  GIT-VERSION-FILE: FORCE\n>>  \t@$(SHELL_PATH) ./GIT-VERSION-GEN\n> \n\n"}]}