From patchwork Mon Nov 19 10:47:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herbert Xu X-Patchwork-Id: 10688487 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 87AAC13AD for ; Mon, 19 Nov 2018 10:55:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7670929ADA for ; Mon, 19 Nov 2018 10:55:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A50729B0E; Mon, 19 Nov 2018 10:55:31 +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 BFF3129ADA for ; Mon, 19 Nov 2018 10:55:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727940AbeKSVSp (ORCPT ); Mon, 19 Nov 2018 16:18:45 -0500 Received: from orcrist.hmeau.com ([104.223.48.154]:43508 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727728AbeKSVSp (ORCPT ); Mon, 19 Nov 2018 16:18:45 -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 1gOhDA-0008VP-Ta; Mon, 19 Nov 2018 18:55:24 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1gOh5D-0001Ng-2t; Mon, 19 Nov 2018 18:47:11 +0800 Date: Mon, 19 Nov 2018 18:47:11 +0800 From: Herbert Xu To: Jilles Tjoelker Cc: ao2@ao2.it, dash@vger.kernel.org Subject: system: Disable gcc warning on sigsetmask Message-ID: <20181119104711.vsdh4tj3joeje65k@gondor.apana.org.au> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20181016203726.GA36439@stack.nl> X-Newsgroups: apana.lists.os.linux.dash Organization: Core 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 Jilles Tjoelker wrote: > > The git history starts (in 2005) after HAVE_SIGSETMASK was added, but I > expect it was done this way to save a few bytes in the executable. With > ProPolice, the effect may be a bit more since a local variable of type > sigset_t often contains an array and may cause functions to be compiled > with stack protection when they otherwise wouldn't (note that > sigclearmask() is inline). > > Both FreeBSD and NetBSD simply changed the sigsetmask() call to a > sigprocmask() call very early on (1995-1996). > > Personally, I think clean code that compiles without warnings is more > important than making the executable as small as possible, but the > maintainer may not agree. I agree with getting rid of the warning, and this seems to work for me. Please let me know if you still a get warning on some other platform. Thanks! ---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. Reported-by: Antonio Ospite Signed-off-by: Herbert Xu diff --git a/src/system.h b/src/system.h index a8d09b3..f3aa930 100644 --- a/src/system.h +++ b/src/system.h @@ -37,7 +37,14 @@ static inline void sigclearmask(void) { #ifdef HAVE_SIGSETMASK +#if defined(__GNUC__) && (__GNUC__ * 1000 + __GNUC_MINOR__) >= 4006 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif sigsetmask(0); +#if defined(__GNUC__) && (__GNUC__ * 1000 + __GNUC_MINOR__) >= 4006 +#pragma GCC diagnostic pop +#endif #else sigset_t set; sigemptyset(&set);