git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Ramsay Jones <ramsay@ramsayjones.plus.com>
To: "Carlo Marcelo Arenas Belón" <carenas@gmail.com>, git@vger.kernel.org
Cc: j6t@kdbg.org, gitster@pobox.com, avarab@gmail.com
Subject: Re: [PATCH v4 3/3] Makefile: restrict -Wpedantic and -Wno-pedantic-ms-format better
Date: Wed, 29 Sep 2021 02:14:02 +0100	[thread overview]
Message-ID: <d19fa4bc-9af7-17cc-86d4-c15ad257cf82@ramsayjones.plus.com> (raw)
In-Reply-To: <20210929004832.96304-4-carenas@gmail.com>



On 29/09/2021 01:48, Carlo Marcelo Arenas Belón wrote:
> 6a8cbc41ba (developer: enable pedantic by default, 2021-09-03)
> enables pedantic mode in as many compilers as possible to help gather
> feedback on future tightening, so lets do so.
> 
> -Wpedantic is missing in some really old gcc 4 versions so lets restrict
> it to gcc5 and clang4 (it does work in clang3 AFAIK, but it will be
> unlikely that a developer will use such an old compiler anyway).
> 
> MinGW gcc is the only one which has -Wno-pedantic-ms-format, and while
> that is available also in older compilers, the Windows SDK provides gcc10
> so let's aim for that.
> 
> Note that in order to target the flag to only Windows, additional changes
> were needed in config.mak.uname to propagate the OS detection which also
> did some minor refactoring, but which is functionaly equivalent.
> 
> Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> ---
>  config.mak.dev   | 7 ++++++-
>  config.mak.uname | 8 +++++++-
>  2 files changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/config.mak.dev b/config.mak.dev
> index cdf043c52b..7673fed114 100644
> --- a/config.mak.dev
> +++ b/config.mak.dev
> @@ -6,14 +6,19 @@ ifeq ($(filter no-error,$(DEVOPTS)),)
>  DEVELOPER_CFLAGS += -Werror
>  SPARSE_FLAGS += -Wsparse-error
>  endif
> +
>  DEVELOPER_CFLAGS += -Wall
>  ifeq ($(filter no-pedantic,$(DEVOPTS)),)
>  DEVELOPER_CFLAGS += -pedantic
> +ifneq (($or $(filter gcc5,$(COMPILER_FEATURES)),$(filter clang4,$(COMPILER_FEATURES))),)
>  DEVELOPER_CFLAGS += -Wpedantic
> -ifneq ($(filter gcc5,$(COMPILER_FEATURES)),)
> +ifneq ($(filter gcc10,$(COMPILER_FEATURES)),)
> +ifeq ($(uname_S),MINGW)
>  DEVELOPER_CFLAGS += -Wno-pedantic-ms-format
>  endif
>  endif
> +endif
> +endif
>  DEVELOPER_CFLAGS += -Wdeclaration-after-statement
>  DEVELOPER_CFLAGS += -Wformat-security
>  DEVELOPER_CFLAGS += -Wold-style-definition
> diff --git a/config.mak.uname b/config.mak.uname
> index 76516aaa9a..124ddfce36 100644
> --- a/config.mak.uname
> +++ b/config.mak.uname
> @@ -11,6 +11,10 @@ uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')
>  uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
>  uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not')
>  
> +ifneq ($(findstring MINGW,$(uname_S)),)
> +	uname_S := MINGW
> +endif
> +
>  ifdef MSVC
>  	# avoid the MingW and Cygwin configuration sections
>  	uname_S := Windows
> @@ -588,7 +592,7 @@ ifeq ($(uname_S),NONSTOP_KERNEL)
>  	SANE_TOOL_PATH = /usr/coreutils/bin:/usr/local/bin
>  	SHELL_PATH = /usr/coreutils/bin/bash
>  endif
> -ifneq (,$(findstring MINGW,$(uname_S)))
> +ifeq ($(uname_S),MINGW)
>  	pathsep = ;
>  	HAVE_ALLOCA_H = YesPlease
>  	NO_PREAD = YesPlease
> @@ -705,6 +709,8 @@ ifeq ($(uname_S),QNX)
>  	NO_STRLCPY = YesPlease
>  endif
>  
> +export uname_S
> +

This export seems to be unnecessary.

ATB,
Ramsay Jones

>  vcxproj:
>  	# Require clean work tree
>  	git update-index -q --refresh && \
> 

  reply	other threads:[~2021-09-29  1:14 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22 19:56 [PATCH cb/pedantic-build-for-developers] lazyload.h: fix warnings about mismatching function pointer types Johannes Sixt
2021-09-22 20:16 ` Carlo Arenas
2021-09-22 21:21   ` Johannes Sixt
2021-09-23  6:20     ` Carlo Arenas
2021-09-23  6:03 ` [PATCH] lazyload.h: use an even more generic function pointer than FARPROC Carlo Marcelo Arenas Belón
2021-09-23  6:33   ` Johannes Sixt
2021-09-23  6:49     ` Carlo Arenas
2021-09-23  6:52   ` [PATCH v2] " Carlo Marcelo Arenas Belón
2021-09-26 10:05     ` [PATCH v3 0/2] js/win-lazyload-buildfix Carlo Marcelo Arenas Belón
2021-09-26 10:05       ` [PATCH v3 1/2] lazyload.h: fix warnings about mismatching function pointer types Carlo Marcelo Arenas Belón
2021-09-27  2:58         ` Eric Sunshine
2021-09-26 10:05       ` [PATCH v3 2/2] lazyload.h: use an even more generic function pointer than FARPROC Carlo Marcelo Arenas Belón
2021-09-27 16:35         ` Junio C Hamano
2021-09-27 18:50           ` Carlo Arenas
2021-09-27 20:13             ` Junio C Hamano
2021-09-29  0:48       ` [PATCH v4 0/3] js/win-lazyload-buildfix Carlo Marcelo Arenas Belón
2021-09-29  0:48         ` [PATCH v4 1/3] lazyload.h: fix warnings about mismatching function pointer types Carlo Marcelo Arenas Belón
2021-09-29  0:48         ` [PATCH v4 2/3] lazyload.h: use an even more generic function pointer than FARPROC Carlo Marcelo Arenas Belón
2021-09-29  0:48         ` [PATCH v4 3/3] Makefile: restrict -Wpedantic and -Wno-pedantic-ms-format better Carlo Marcelo Arenas Belón
2021-09-29  1:14           ` Ramsay Jones [this message]
2021-09-29  3:19         ` [PATCH v5 0/3] js/win-lazyload-buildfix Carlo Marcelo Arenas Belón
2021-09-29  3:19           ` [PATCH v5 1/3] lazyload.h: fix warnings about mismatching function pointer types Carlo Marcelo Arenas Belón
2021-09-29  3:19           ` [PATCH v5 2/3] lazyload.h: use an even more generic function pointer than FARPROC Carlo Marcelo Arenas Belón
2021-09-29  3:19           ` [PATCH v5 3/3] Makefile: restrict -Wpedantic and -Wno-pedantic-ms-format better Carlo Marcelo Arenas Belón
2021-09-23 21:00 ` [PATCH cb/pedantic-build-for-developers] lazyload.h: fix warnings about mismatching function pointer types Carlo Arenas

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=d19fa4bc-9af7-17cc-86d4-c15ad257cf82@ramsayjones.plus.com \
    --to=ramsay@ramsayjones.plus.com \
    --cc=avarab@gmail.com \
    --cc=carenas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.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).