From patchwork Wed Sep 29 03:19:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= X-Patchwork-Id: 12524487 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4A70C4332F for ; Wed, 29 Sep 2021 03:19:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 83E9B6138F for ; Wed, 29 Sep 2021 03:19:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243881AbhI2DVe (ORCPT ); Tue, 28 Sep 2021 23:21:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243834AbhI2DVd (ORCPT ); Tue, 28 Sep 2021 23:21:33 -0400 Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEAF2C06161C for ; Tue, 28 Sep 2021 20:19:53 -0700 (PDT) Received: by mail-qv1-xf36.google.com with SMTP id x9so656042qvn.12 for ; Tue, 28 Sep 2021 20:19:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xAO+3NfaiMMerkMiqWQIE69+zQfFZyiGUDY/RjSN4Y0=; b=Vra7n8wnSSSjsEIDuZHAm7I4ImK+PdrOtwgHdQhHPWHwXiZ+wOBqThiImquSz7Uuzu dN9jEsGDHlGUYTgYhEv2IatnjbB3JVBhcSNI75wO0U9sqDd0cFFc9GvBHLJblNcqYiIl JYS6DO2S9IHLNn7HIWVp7ZJ643+gsqFWW1UAftmKM1w95/ODYKNJEu0lRppHv++fuKr+ wZoU3bA/gzVFSf/K0u1z/Q1rXXKAAtM6wfuYgZMp5Ws9zfwmyWXbSAENcpL+5o2SHITf SfnFT6We6xAacXoIGDm+O1epGcv88JNg0RYgKq70I8YF3a7bQ0b2ZEpc1fWKYjLKl3iz AwCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xAO+3NfaiMMerkMiqWQIE69+zQfFZyiGUDY/RjSN4Y0=; b=c3pvZaTpNyI9xu9r6UoHlqmlUYOMoAufqIRpqHBlZ9aKYgM5uFCULd9zTJRIihZe/X mGBQD3rGGj0nYZLTYM+RwRtREF2nKVa2mJCsuOQKZm7/2ey6isWkqxbuWCnfCXAY30+1 E/QyJeR5tgYNHQiZL97Rh/+zRiiHrOtzQs3aq+IuVh2BiGDUKNJou8Al08kxoADXwQle D09E9iZbWjXJfzR08OIvmXevd+Lqj5OrotM7oA2uf1JfjQVPICTRZDuYIqstDSUF4kmN 9uche7SDlR9BcI7DUabn0eEZ+Uo1JK7hTnAXmXfHHflvZb6uASA2T0XvO6dZQRMT2K7Z 9EGA== X-Gm-Message-State: AOAM530ir+7o9cuypTXwMuh7vilem7Re4sCnMvXuhlBdhSx7riL/adAB vqgYKPTwAitgXMoTs4Oyj8FMEIlZwgDb1A== X-Google-Smtp-Source: ABdhPJwR+uYOcOLgtP3hT1N7pkSuLasCH41f14DoeuoAPdyi1na6aG+slNOJOO2MGhDDnL+AMHPvaw== X-Received: by 2002:a0c:9d05:: with SMTP id m5mr8917021qvf.30.1632885592716; Tue, 28 Sep 2021 20:19:52 -0700 (PDT) Received: from carlos-mbp.lan (104-1-92-200.lightspeed.sntcca.sbcglobal.net. [104.1.92.200]) by smtp.gmail.com with ESMTPSA id h2sm801350qkk.10.2021.09.28.20.19.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Sep 2021 20:19:52 -0700 (PDT) From: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= To: git@vger.kernel.org Cc: j6t@kdbg.org, gitster@pobox.com, avarab@gmail.com, jonathantanmy@google.com, ramsay@ramsayjones.plus.com, =?utf-8?q?Carlo_Marc?= =?utf-8?q?elo_Arenas_Bel=C3=B3n?= Subject: [PATCH v5 1/3] lazyload.h: fix warnings about mismatching function pointer types Date: Tue, 28 Sep 2021 20:19:38 -0700 Message-Id: <20210929031940.97092-2-carenas@gmail.com> X-Mailer: git-send-email 2.33.0.955.gee03ddbf0e In-Reply-To: <20210929031940.97092-1-carenas@gmail.com> References: <20210929004832.96304-1-carenas@gmail.com> <20210929031940.97092-1-carenas@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Sixt Here, GCC warns about every use of the INIT_PROC_ADDR macro, for example: In file included from compat/mingw.c:8: compat/mingw.c: In function 'mingw_strftime': compat/win32/lazyload.h:38:12: warning: assignment to 'size_t (*)(char *, size_t, const char *, const struct tm *)' {aka 'long long unsigned int (*)(char *, long long unsigned int, const char *, const struct tm *)'} from incompatible pointer type 'FARPROC' {aka 'long long int (*)()'} [-Wincompatible-pointer-types] 38 | (function = get_proc_addr(&proc_addr_##function)) | ^ compat/mingw.c:1014:6: note: in expansion of macro 'INIT_PROC_ADDR' 1014 | if (INIT_PROC_ADDR(strftime)) | ^~~~~~~~~~~~~~ (message wrapped for convenience). Insert a cast to keep the compiler happy. A cast is fine in these cases because they are generic function pointer values that have been looked up in a DLL. Helped-by: Carlo Marcelo Arenas Belón Signed-off-by: Johannes Sixt Signed-off-by: Junio C Hamano --- compat/win32/lazyload.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compat/win32/lazyload.h b/compat/win32/lazyload.h index d2056cdadf..121ee24ed2 100644 --- a/compat/win32/lazyload.h +++ b/compat/win32/lazyload.h @@ -26,7 +26,8 @@ struct proc_addr { #define DECLARE_PROC_ADDR(dll, rettype, function, ...) \ static struct proc_addr proc_addr_##function = \ { #dll, #function, NULL, 0 }; \ - static rettype (WINAPI *function)(__VA_ARGS__) + typedef rettype (WINAPI *proc_type_##function)(__VA_ARGS__); \ + static proc_type_##function function /* * Loads a function from a DLL (once-only). @@ -35,7 +36,7 @@ struct proc_addr { * This function is not thread-safe. */ #define INIT_PROC_ADDR(function) \ - (function = get_proc_addr(&proc_addr_##function)) + (function = (proc_type_##function)get_proc_addr(&proc_addr_##function)) static inline FARPROC get_proc_addr(struct proc_addr *proc) { From patchwork Wed Sep 29 03:19:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= X-Patchwork-Id: 12524489 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06045C433F5 for ; Wed, 29 Sep 2021 03:19:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E4261613DB for ; Wed, 29 Sep 2021 03:19:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243889AbhI2DVg (ORCPT ); Tue, 28 Sep 2021 23:21:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243834AbhI2DVf (ORCPT ); Tue, 28 Sep 2021 23:21:35 -0400 Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF7F7C06161C for ; Tue, 28 Sep 2021 20:19:54 -0700 (PDT) Received: by mail-qt1-x82b.google.com with SMTP id r16so1034640qtw.11 for ; Tue, 28 Sep 2021 20:19:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=o2gHayGbXHdGSC6xUkdq/H1zd+A2QITax01lNUG1AeU=; b=LQLZy383U0c3df5rbDpBNIArsM/R3S3wXu1/l4cpqdZl1w0xUrq4W4A7OEbAtbBeQ4 3vK991JQdEF7a0tW3bBwrivnEWXW7FNu+2iSinHBok4B0Gs/Bui+ogeG4XRSVCnF1ftD yPOBhy1TX8J0szPg5dHOT5mCMpDxOQ4IL7NJJUixEQ3oQ7vjyV25zwGy+5E4XKipHuGN fomgltz6tSeaMcuL3maDCkVDzcmI1E/3VYGosjYgwzLLCSddSyECIbE/SCa24+7b5Xq0 M6V4WP5J398QIu6l+23wZaAgf0yKfNED5e57YPbSTp9c8vBbhBldNRkxe2c7LB73oZa4 HhGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=o2gHayGbXHdGSC6xUkdq/H1zd+A2QITax01lNUG1AeU=; b=m9Xjwm0q577zgOaBHfPZO9cblRB1NK5jrihUF3KV7chGIHFpRYQHCFUS1K8ndNAQwd oAnlB29Vq7w7XZl52n43Tgm8dXfac3cKckO5mddwYVRGPb3SHtaWzK8WVxVNdF0Of+Bw DqtbPYUwkcG0b06Vc/MsXLQdrtwpj70E8mh59LQTxSeAt9BrMTcOZhNLNWTbzWPMzT/q gy4pnHa+sd3WkJP6kvU3LJDXRpgqrK31PGJuLV/WvKt7aHTRnSyT/fPVC0nc4jeOJLg+ GLUomB2gtJDQ3EumHBmvJNlgeU+G/hnR1lkDKoFUim5rsqhSBhX8P3AyzniR73gMdwZN BmyA== X-Gm-Message-State: AOAM532U6WY9V2x1lXPamDLT0QRKCz4Vi+4TbOj4N47dbem9axQvxtPT UEROhz/h3YqzGvWGJ3LmouKh4MDHGD/YPQ== X-Google-Smtp-Source: ABdhPJy6Ez2Gc1Ddv4MF1ybbo7GEGQ5MDncpLfLWejQFm3SN0kgo9hdzaLz4bRVR4OmCd1qnkCvoEA== X-Received: by 2002:aed:279d:: with SMTP id a29mr9345037qtd.143.1632885593998; Tue, 28 Sep 2021 20:19:53 -0700 (PDT) Received: from carlos-mbp.lan (104-1-92-200.lightspeed.sntcca.sbcglobal.net. [104.1.92.200]) by smtp.gmail.com with ESMTPSA id h2sm801350qkk.10.2021.09.28.20.19.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Sep 2021 20:19:53 -0700 (PDT) From: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= To: git@vger.kernel.org Cc: j6t@kdbg.org, gitster@pobox.com, avarab@gmail.com, jonathantanmy@google.com, ramsay@ramsayjones.plus.com, =?utf-8?q?Carlo_Marc?= =?utf-8?q?elo_Arenas_Bel=C3=B3n?= Subject: [PATCH v5 2/3] lazyload.h: use an even more generic function pointer than FARPROC Date: Tue, 28 Sep 2021 20:19:39 -0700 Message-Id: <20210929031940.97092-3-carenas@gmail.com> X-Mailer: git-send-email 2.33.0.955.gee03ddbf0e In-Reply-To: <20210929031940.97092-1-carenas@gmail.com> References: <20210929004832.96304-1-carenas@gmail.com> <20210929031940.97092-1-carenas@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org gcc will helpfully raise a -Wcast-function-type warning when casting between functions that might have incompatible return types (ex: GetUserNameExW returns bool which is only half the size of the return type from FARPROC which is long long), so create a new type that could be used as a completely generic function pointer and cast through it instead. Additionaly remove the -Wno-incompatible-pointer-types temporary flag added in 27e0c3c (win32: allow building with pedantic mode enabled, 2021-09-03), as it will be no longer needed. Signed-off-by: Carlo Marcelo Arenas Belón Signed-off-by: Junio C Hamano --- compat/win32/lazyload.h | 9 ++++++--- config.mak.dev | 1 - 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/compat/win32/lazyload.h b/compat/win32/lazyload.h index 121ee24ed2..2b3637135f 100644 --- a/compat/win32/lazyload.h +++ b/compat/win32/lazyload.h @@ -15,10 +15,12 @@ * source, target); */ +typedef void (*FARVOIDPROC)(void); + struct proc_addr { const char *const dll; const char *const function; - FARPROC pfunction; + FARVOIDPROC pfunction; unsigned initialized : 1; }; @@ -38,7 +40,7 @@ struct proc_addr { #define INIT_PROC_ADDR(function) \ (function = (proc_type_##function)get_proc_addr(&proc_addr_##function)) -static inline FARPROC get_proc_addr(struct proc_addr *proc) +static inline FARVOIDPROC get_proc_addr(struct proc_addr *proc) { /* only do this once */ if (!proc->initialized) { @@ -47,7 +49,8 @@ static inline FARPROC get_proc_addr(struct proc_addr *proc) hnd = LoadLibraryExA(proc->dll, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32); if (hnd) - proc->pfunction = GetProcAddress(hnd, proc->function); + proc->pfunction = (FARVOIDPROC)GetProcAddress(hnd, + proc->function); } /* set ENOSYS if DLL or function was not found */ if (!proc->pfunction) diff --git a/config.mak.dev b/config.mak.dev index c080ac0231..cdf043c52b 100644 --- a/config.mak.dev +++ b/config.mak.dev @@ -12,7 +12,6 @@ DEVELOPER_CFLAGS += -pedantic DEVELOPER_CFLAGS += -Wpedantic ifneq ($(filter gcc5,$(COMPILER_FEATURES)),) DEVELOPER_CFLAGS += -Wno-pedantic-ms-format -DEVELOPER_CFLAGS += -Wno-incompatible-pointer-types endif endif DEVELOPER_CFLAGS += -Wdeclaration-after-statement From patchwork Wed Sep 29 03:19:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= X-Patchwork-Id: 12524491 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 172DAC433FE for ; Wed, 29 Sep 2021 03:19:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F29E76138F for ; Wed, 29 Sep 2021 03:19:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243906AbhI2DVi (ORCPT ); Tue, 28 Sep 2021 23:21:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243892AbhI2DVh (ORCPT ); Tue, 28 Sep 2021 23:21:37 -0400 Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9D37C06161C for ; Tue, 28 Sep 2021 20:19:56 -0700 (PDT) Received: by mail-qt1-x82e.google.com with SMTP id e16so1019460qte.13 for ; Tue, 28 Sep 2021 20:19:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WlSebNwYPqeonzOR1gZ4SXx7Vt5FfOi/vCYHqKbPDW0=; b=Z3KBXk1DSdnTAdmfSojC6nzqO2K6svjQSWWh7kfb12jsc6xOi56p1ommJn9W9d+ug1 /HPh91OOrehjy2BKs/TAJBIW07y0WhNxn+eqmn06futer+U0UDL4pumIL0O7zf7Z/zYK giwPa9i6BQ9+pWzyTpD8/+V/6S6Th+tqZ9eeLYfOVjsn7hWtnZAnkyawqpXwuwU/X7jr mS/k5SP60ynF4TmWnOC1bi/yvh2G4frNvYmzu0ZH/3YPzUG6xV4NCnyuu/Qhakb4l0AA 7ejiT0sckoeNPlceByPxkXUyRtJSTQFe4VCi1khq1PWCM1XGEEWw4FLiWoUTappp8SDL nGQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WlSebNwYPqeonzOR1gZ4SXx7Vt5FfOi/vCYHqKbPDW0=; b=OTTY2k4vuEtI/EDcS9iWzlsPJisLPi5C9Rj72v2lW1AZpXNKsOnjJ2n51QkCdOMpPV Ro5RoR7pMFguT6Pzu+32m38+MrKcHfvRl3DjYSVbuIlrTAXMHwSkVWx/AMiBxXCcC0UI vpqp2Ul638zQgCwuKbqQAF+m8mmHxJdorqH1Xstcz1m/lEQY3pWIw1LLEeD2dKTdpiek KCXAtj2PyYHnTrYdGJBzpJPbpwUAw42RvIAOqZXuB2JB24iO7eYBoBWcOSVMpQY5wAr/ kL3Z4TlfMVyLKCUO+T/Zxsrae+rcVSS7WELiClDQAowpwuCK+k1mapo/BF2xPbD2Uzty 2EYw== X-Gm-Message-State: AOAM532DWV+Pqlr+xGlAWqBL4JjxIsZyA1SnsWhgZpa2mVI3wDtWonJR Tw4qD1uiB3XvIPSyoxbq63HrokonpcGUMg== X-Google-Smtp-Source: ABdhPJzoVS4YMkepfu7PCI/0ilymsdhenu5/VGNi9nBuhcD/NA1a3aIMFYKFwutTornjC+4fvBEu0g== X-Received: by 2002:ac8:4113:: with SMTP id q19mr9574932qtl.108.1632885595438; Tue, 28 Sep 2021 20:19:55 -0700 (PDT) Received: from carlos-mbp.lan (104-1-92-200.lightspeed.sntcca.sbcglobal.net. [104.1.92.200]) by smtp.gmail.com with ESMTPSA id h2sm801350qkk.10.2021.09.28.20.19.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Sep 2021 20:19:54 -0700 (PDT) From: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= To: git@vger.kernel.org Cc: j6t@kdbg.org, gitster@pobox.com, avarab@gmail.com, jonathantanmy@google.com, ramsay@ramsayjones.plus.com, =?utf-8?q?Carlo_Marc?= =?utf-8?q?elo_Arenas_Bel=C3=B3n?= Subject: [PATCH v5 3/3] Makefile: restrict -Wpedantic and -Wno-pedantic-ms-format better Date: Tue, 28 Sep 2021 20:19:40 -0700 Message-Id: <20210929031940.97092-4-carenas@gmail.com> X-Mailer: git-send-email 2.33.0.955.gee03ddbf0e In-Reply-To: <20210929031940.97092-1-carenas@gmail.com> References: <20210929004832.96304-1-carenas@gmail.com> <20210929031940.97092-1-carenas@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 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 lets 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 Signed-off-by: Carlo Marcelo Arenas Belón --- config.mak.dev | 7 ++++++- config.mak.uname | 6 +++++- 2 files changed, 11 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..2b178bad58 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