From patchwork Wed Nov 21 03:45:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herbert Xu X-Patchwork-Id: 10691861 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CA83716B1 for ; Wed, 21 Nov 2018 03:45:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2F7E29373 for ; Wed, 21 Nov 2018 03:45:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3FF129478; Wed, 21 Nov 2018 03:45:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CC4329373 for ; Wed, 21 Nov 2018 03:45:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727223AbeKUORu (ORCPT ); Wed, 21 Nov 2018 09:17:50 -0500 Received: from orcrist.hmeau.com ([104.223.48.154]:48274 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726195AbeKUORu (ORCPT ); Wed, 21 Nov 2018 09:17:50 -0500 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1gPJRs-0001Xi-Tk; Wed, 21 Nov 2018 11:45:08 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1gPJRo-0003kv-AD; Wed, 21 Nov 2018 11:45:04 +0800 Date: Wed, 21 Nov 2018 11:45:04 +0800 From: Herbert Xu To: Antonio Ospite Cc: Jilles Tjoelker , dash@vger.kernel.org Subject: [v2 PATCH] system: Disable glibc warning on sigsetmask Message-ID: <20181121034504.eheaeyautxx7k4e3@gondor.apana.org.au> References: <20181016203726.GA36439@stack.nl> <20181119104711.vsdh4tj3joeje65k@gondor.apana.org.au> <20181120234820.a9ea308038b1445df046130b@ao2.it> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20181120234820.a9ea308038b1445df046130b@ao2.it> User-Agent: NeoMutt/20170113 (1.7.2) Sender: dash-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dash@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Nov 20, 2018 at 11:48:20PM +0100, Antonio Ospite wrote: > > Just for the record, compiling with clang (CC=clang ./configure && make) > still gives a warning: OK, we could disable it completely unless it's gcc: ---8<--- As sigsetmask is set as deprecated in glibc this patch adds the pragmas to disable the warning in gcc around our one and only use of sigsetmask. It also disables it completely for non-gcc compilers and older gcc compilers as they may generate a warning too. Reported-by: Antonio Ospite Signed-off-by: Herbert Xu diff --git a/src/system.h b/src/system.h index a8d09b3..007952c 100644 --- a/src/system.h +++ b/src/system.h @@ -36,8 +36,17 @@ static inline void sigclearmask(void) { -#ifdef HAVE_SIGSETMASK +#if defined(HAVE_SIGSETMASK) && \ + (!defined(__GLIBC__) || \ + (defined(__GNUC__) && (__GNUC__ * 1000 + __GNUC_MINOR__) >= 4006)) +#ifdef __GLIBC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif sigsetmask(0); +#ifdef __GLIBC__ +#pragma GCC diagnostic pop +#endif #else sigset_t set; sigemptyset(&set);