From patchwork Thu Oct 15 21:22:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 40736 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A1F6A3857C57; Thu, 15 Oct 2020 21:22:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A1F6A3857C57 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1602796970; bh=W/5bs3SXKLlytqmWAQUiUEATuQZtArKuvB6IwGOuEnk=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=aU0zPgYuaTvlCQsPXi6qjF+650jxncvJfKXNjcMxq9bq3iN15bP9mMrRSR0Bvu68b 6fdTiKuDUJZylNtQZ4CkjDDdu4WsuJzvPbKjFtEC5LT+ZeCy7XU+VMTGBpqTeVml8r eCvHBnwlt545okFCyVyFfBS1jzQfnJjc36jP0AYg= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x243.google.com (mail-oi1-x243.google.com [IPv6:2607:f8b0:4864:20::243]) by sourceware.org (Postfix) with ESMTPS id 5D9063858C27 for ; Thu, 15 Oct 2020 21:22:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5D9063858C27 Received: by mail-oi1-x243.google.com with SMTP id 16so53916oix.9 for ; Thu, 15 Oct 2020 14:22:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=W/5bs3SXKLlytqmWAQUiUEATuQZtArKuvB6IwGOuEnk=; b=lWhBbjekQF14lGtCtq7Ck+XedrqROFUwlWs/23dMRpdXU5fF3xOa0Ro6xMQ3DXAiLT JcE2Fexbz+Zv+1sPmeQoZLtxyVrtlvFOwxcMS3zuxhXOp/uuN/JWsmY2I00MVdP7wyv1 qi7sukhzoHWgSMkUQqldsja0DM2eKTgTzqfPSjBF2RNfU8139R/kvIF31Bokn9ZdBJgG /4cCst5XJmanbr6bChX4f2Ja3XYYKjQsnGT46bnCfjEiMrgPQkFGcVKggDJNVZpuBpMY EsnhAVPQVD0JTSaMwT9Q9lxQJ7pqGOFyGqgpWawAB947n6Mpw4tIvaX8Xs2o91L3POJU ildA== X-Gm-Message-State: AOAM531oF1dKU5S1j7dR54Ryi16gnEBrL7a1+FzfyEd41+L4AvEeAps8 5VzmY9gnWdawKdI2+wOlMKuDZ/fuIH9GGhTyLpSPKQ/p X-Google-Smtp-Source: ABdhPJyusYEFMjurS5TbGWzkUx1JamnE49d+LdaLdVfbJgmLIXJEXGe3W1r1MwfqfmUhIpzMB2oGPKVe1A4c0G4RMJY= X-Received: by 2002:aca:4c7:: with SMTP id 190mr346505oie.58.1602796966655; Thu, 15 Oct 2020 14:22:46 -0700 (PDT) MIME-Version: 1.0 References: <20201010121935.3263605-1-hjl.tools@gmail.com> <20201014174659.GL32292@arm.com> <20201015122653.GA319424@gmail.com> In-Reply-To: Date: Thu, 15 Oct 2020 14:22:10 -0700 Message-ID: Subject: V2 [PATCH] Deprecate SIGSTKSZ/MINSIGSTKSZ with _SC_SIGSTKSZ_SOURCE To: Joseph Myers X-Spam-Status: No, score=-3036.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "H.J. Lu via Libc-alpha" From: "H.J. Lu" Reply-To: "H.J. Lu" Cc: GNU C Library , Dave Martin Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" On Thu, Oct 15, 2020 at 12:59 PM Joseph Myers wrote: > > On Thu, 15 Oct 2020, H.J. Lu via Libc-alpha wrote: > > > +__attribute_deprecated_msg__ ("Use sysconf (_SC_SIGSTKSZ) instead") > > +__extern_always_inline long > > +SIGSTKSZ_is_deprecated (void) > > +{ > > + return sysconf (_SC_SIGSTKSZ); > > +} > > + > > +__attribute_deprecated_msg__ ("Use sysconf (_SC_MINSIGSTKSZ) instead") > > +__extern_always_inline long > > +MINSIGSTKSZ_is_deprecated (void) > > +{ > > + return sysconf (_SC_SIGSTKSZ); > > +} > > Those function names should start with '__' rather than claiming the names > SIGSTKSZ_is_deprecated and MINSIGSTKSZ_is_deprecated from the user's > namespace. > Like this? Reviewed-by: Carlos O'Donell From a9b02d82571c0b0e0a5d4b46f0683a5341046bdf Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 15 Oct 2020 05:21:28 -0700 Subject: [PATCH] Deprecate SIGSTKSZ/MINSIGSTKSZ with _SC_SIGSTKSZ_SOURCE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When _SC_SIGSTKSZ_SOURCE is defined, deprecate SIGSTKSZ and MINSIGSTKSZ: tst-minsigstksz-5.c: In function ‘do_test’: tst-minsigstksz-5.c:46:3: warning: ‘__MINSIGSTKSZ’ is deprecated: Use sysconf (_SC_MINSIGSTKSZ) instead of MINSIGSTKSZ [-Wdeprecated-declarations] 46 | void *stack_bottom = stack_buffer + (stack_buffer_size + MINSIGSTKSZ) / 2; | ^~~~ In file included from ../signal/signal.h:315, from ../include/signal.h:2, from tst-minsigstksz-5.c:19: ../sysdeps/unix/sysv/linux/bits/sigstksz.h:35:1: note: declared here 35 | __MINSIGSTKSZ (void) | ^~~~~~~~~~~~~ --- sysdeps/unix/sysv/linux/Makefile | 6 ++++-- sysdeps/unix/sysv/linux/bits/sigstksz.h | 18 ++++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index b51a02a6e6..5576c729ae 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -189,9 +189,11 @@ sysdep_headers += sys/timex.h bits/timex.h sysdep_routines += ntp_gettime ntp_gettimex endif +CFLAGS-SIGSTKSZ += -D_SC_SIGSTKSZ_SOURCE -Wno-error=deprecated-declarations + ifeq ($(subdir),signal) # Compile tst-minsigstksz-5.c with _SC_SIGSTKSZ_SOURCE. -CFLAGS-tst-minsigstksz-5.c += -D_SC_SIGSTKSZ_SOURCE +CFLAGS-tst-minsigstksz-5.c += $(CFLAGS-SIGSTKSZ) tests-special += $(objpfx)tst-signal-numbers.out # Depending on signal.o* is a hack. What we actually want is a dependency @@ -233,7 +235,7 @@ endif ifeq ($(subdir),support) # Compile xsigstack.c with _SC_SIGSTKSZ_SOURCE. -CFLAGS-xsigstack.c += -D_SC_SIGSTKSZ_SOURCE +CFLAGS-xsigstack.c += $(CFLAGS-SIGSTKSZ) endif ifeq ($(subdir),termios) diff --git a/sysdeps/unix/sysv/linux/bits/sigstksz.h b/sysdeps/unix/sysv/linux/bits/sigstksz.h index cd5b3cc895..b90a614de6 100644 --- a/sysdeps/unix/sysv/linux/bits/sigstksz.h +++ b/sysdeps/unix/sysv/linux/bits/sigstksz.h @@ -23,11 +23,25 @@ #if __USE_SC_SIGSTKSZ # include +__attribute_deprecated_msg__ ("Use sysconf (_SC_SIGSTKSZ) instead of SIGSTKSZ") +__extern_always_inline long +__SIGSTKSZ (void) +{ + return sysconf (_SC_SIGSTKSZ); +} + +__attribute_deprecated_msg__ ("Use sysconf (_SC_MINSIGSTKSZ) instead of MINSIGSTKSZ") +__extern_always_inline long +__MINSIGSTKSZ (void) +{ + return sysconf (_SC_SIGSTKSZ); +} + /* Default stack size for a signal handler: sysconf (SC_SIGSTKSZ). */ # undef SIGSTKSZ -# define SIGSTKSZ sysconf (_SC_SIGSTKSZ) +# define SIGSTKSZ __SIGSTKSZ () /* Minimum stack size for a signal handler: SIGSTKSZ. */ # undef MINSIGSTKSZ -# define MINSIGSTKSZ SIGSTKSZ +# define MINSIGSTKSZ __MINSIGSTKSZ () #endif -- 2.26.2