From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from black.elm.relay.mailchannels.net (black.elm.relay.mailchannels.net [23.83.212.19]) by sourceware.org (Postfix) with ESMTPS id AB03B3858D32 for ; Tue, 4 Jul 2023 23:53:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AB03B3858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gotplt.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 93C6C641DC1; Tue, 4 Jul 2023 23:53:47 +0000 (UTC) Received: from pdx1-sub0-mail-a286.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 249DE6419E4; Tue, 4 Jul 2023 23:53:47 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1688514827; a=rsa-sha256; cv=none; b=ZP4wUUUS/bkgXZ5duIJbNQnG1O7x/8sXtnwGkD6POFn3smcNmrG11yXQtFO2ydNVykT6yi wf+KcND0gPpPlxxuZsOXpV5xCgFtlH0l8KWIOHOYXcO96s//9ODXLJO0GT2Cal0srvV1xB 4220yPkCPkf2eo6H7J7+XD6NAra1kCYa3h5ixxTA4jeYhyQKixbG80KMadbFDv6kGC6M9h h8dK+JM5/LEpzdqb5jH5L06/Ptou+HDNmM66CV20PFYaXb99B4JmKV89cuuIgh5p4+2cdF I4Es6xldSS/1pnjr/5iwuQecTq/tYkLFGiif9UKgWehRQPk3MLhzqWMPsRuqYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1688514827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=nmrm2J1CIfeRRXM8qQcoBvhfQbrjNmTZwe6MLb2tGBM=; b=6UhSzJ6r5gyDTWsZp1RzCsjaH0lPA1o5ervl1Hsux47Gj3WDT0OTVNbUUq0bYm9wi8UxUp VvMhnuN8zEIKF5zpXcwHoSVGkoGyy+V3lpYACgfyoKKfG5g8Mg9uvqBd39pmtCraL5ytOF XYCB1tZZfIPqPiyJ2NganULNOeNLfwK8NmfwjukuZxIuOBv/S7hnPDPultkVPjqnW1YCJS OFgDmU6r2eUUFO9Q66sl+p/xkZGr9GQSXqNVrpEOXkHalQ6QtlY3zaAKdZfNY9AQix9xtF 8TVXNSFjoti6TWQFIF+oxgr4PYfIgtJKLEI8e1512atQepcS7/lHMVwH/NqoYA== ARC-Authentication-Results: i=1; rspamd-9fcc56855-twxqs; auth=pass smtp.auth=dreamhost smtp.mailfrom=siddhesh@gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Blushing-Eyes: 489395572fdee54c_1688514827393_2883176548 X-MC-Loop-Signature: 1688514827392:820614750 X-MC-Ingress-Time: 1688514827392 Received: from pdx1-sub0-mail-a286.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.119.120.20 (trex/6.9.1); Tue, 04 Jul 2023 23:53:47 +0000 Received: from [192.168.0.182] (bras-vprn-toroon4834w-lp130-09-174-91-45-44.dsl.bell.ca [174.91.45.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a286.dreamhost.com (Postfix) with ESMTPSA id 4Qwfky5KK6zBB; Tue, 4 Jul 2023 16:53:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gotplt.org; s=dreamhost; t=1688514826; bh=nmrm2J1CIfeRRXM8qQcoBvhfQbrjNmTZwe6MLb2tGBM=; h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding; b=NB2cJZQeMocg6RIRVohrVpny15gxPKxM8OU5LhCTtshHbkzeFRVnFBmZgd9D5R2lU 0oUTzNiBIEoSGVmizPFWbhFMw/2Ka33VZxnNkNnxRvnvv7V/IMWoArQsjtVIofnKg4 EFjpeS3thRaODjbTnrty0FEUw969+1AiAoXk8tK67Hbz0GRmZY+1t7cNkWfzGdcOVE MtMzTa3UWPyMI+9xqsBL/Fq109HKQtN9WkCaxDdRZFq4C5Un/AZGW0GPPusMcHHSr6 LFrvJgRNXvUPIPahN1rSwzWdhmhptLHrprexh7V8qtZX371NJXV+ndSTKqJdYTyKe9 DxUouoeK3UuLg== Message-ID: <34e6566f-da52-a11f-eaa0-b289d2c75721@gotplt.org> Date: Tue, 4 Jul 2023 19:53:44 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v4 10/15] misc/bits/select2.h: Clearly separate declaration from definitions Content-Language: en-US To: =?UTF-8?B?RnLDqWTDqXJpYyBCw6lyYXQ=?= , libc-alpha@sourceware.org References: <20230704165554.239581-1-fberat@redhat.com> <20230704165554.239581-11-fberat@redhat.com> From: Siddhesh Poyarekar In-Reply-To: <20230704165554.239581-11-fberat@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3037.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2023-07-04 12:55, Frédéric Bérat wrote: > The __fdelt_chk declaration needs to be available so that > libc_hidden_proto can be used while not redefining __FD_ELT. > Thus, misc/bits/select-decl.h is created to hold the corresponding > prototypes. > --- > debug/fdelt_chk.c | 1 + > include/bits/select-decl.h | 1 + > include/sys/select.h | 4 ++++ > misc/Makefile | 1 + > misc/bits/select-decl.h | 31 +++++++++++++++++++++++++++++++ > misc/bits/select2.h | 6 ++---- > 6 files changed, 40 insertions(+), 4 deletions(-) > create mode 100644 include/bits/select-decl.h > create mode 100644 misc/bits/select-decl.h Reviewed-by: Siddhesh Poyarekar > > diff --git a/debug/fdelt_chk.c b/debug/fdelt_chk.c > index d1d3a19460..bcf8f333f9 100644 > --- a/debug/fdelt_chk.c > +++ b/debug/fdelt_chk.c > @@ -28,3 +28,4 @@ __fdelt_chk (long int d) > return d / __NFDBITS; > } > strong_alias (__fdelt_chk, __fdelt_warn) > +libc_hidden_def (__fdelt_chk) > diff --git a/include/bits/select-decl.h b/include/bits/select-decl.h > new file mode 100644 > index 0000000000..43db738a61 > --- /dev/null > +++ b/include/bits/select-decl.h > @@ -0,0 +1 @@ > +#include > diff --git a/include/sys/select.h b/include/sys/select.h > index a8961afbed..45376461e9 100644 > --- a/include/sys/select.h > +++ b/include/sys/select.h > @@ -3,6 +3,10 @@ > > #ifndef _ISOMAC > /* Now define the internal interfaces. */ > + > +#include > +libc_hidden_proto (__fdelt_chk) > + > # if __TIMESIZE == 64 > # define __pselect64 __pselect > # define __select64 __select > diff --git a/misc/Makefile b/misc/Makefile > index 36ba7a0bad..3497d30f3b 100644 > --- a/misc/Makefile > +++ b/misc/Makefile > @@ -68,6 +68,7 @@ headers := \ > bits/syslog-ldbl.h \ > bits/syslog-path.h \ > bits/error.h \ > + bits/select-decl.h \ > bits/select2.h \ > bits/hwcap.h \ > sys/auxv.h \ > diff --git a/misc/bits/select-decl.h b/misc/bits/select-decl.h > new file mode 100644 > index 0000000000..95962e1b98 > --- /dev/null > +++ b/misc/bits/select-decl.h > @@ -0,0 +1,31 @@ > +/* Checking routines for select functions. Declaration only. > + Copyright (C) 2023 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library; if not, see > + . */ > + > +#ifndef _BITS_SELECT_DECL_H > +#define _BITS_SELECT_DECL_H 1 > + > +#ifndef _SYS_SELECT_H > +# error "Never include directly; use instead." > +#endif > + > +/* Helper functions to issue warnings and errors when needed. */ > +extern long int __fdelt_chk (long int __d); > +extern long int __fdelt_warn (long int __d) > + __warnattr ("bit outside of fd_set selected"); > + > +#endif > diff --git a/misc/bits/select2.h b/misc/bits/select2.h > index abd84a19d5..91e85c87d1 100644 > --- a/misc/bits/select2.h > +++ b/misc/bits/select2.h > @@ -20,10 +20,8 @@ > # error "Never include directly; use instead." > #endif > > -/* Helper functions to issue warnings and errors when needed. */ > -extern long int __fdelt_chk (long int __d); > -extern long int __fdelt_warn (long int __d) > - __warnattr ("bit outside of fd_set selected"); > +#include > + > #undef __FD_ELT > #define __FD_ELT(d) \ > __extension__ \