From owner-svn-src-all@freebsd.org Fri Feb 12 17:36:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10A9AAA6576; Fri, 12 Feb 2016 17:36:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CBA0162D; Fri, 12 Feb 2016 17:36:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u1CHafah086376 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 12 Feb 2016 19:36:41 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u1CHafah086376 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u1CHafEQ086375; Fri, 12 Feb 2016 19:36:41 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 12 Feb 2016 19:36:41 +0200 From: Konstantin Belousov To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295561 - in head: include sys/mips/include sys/powerpc/include sys/sparc64/include sys/sys sys/x86/include Message-ID: <20160212173641.GV91220@kib.kiev.ua> References: <201602120738.u1C7cKpq093956@repo.freebsd.org> <20160212232717.P894@besplex.bde.org> <20160212143630.GS91220@kib.kiev.ua> <20160213021939.S1340@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160213021939.S1340@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 17:36:48 -0000 On Sat, Feb 13, 2016 at 03:56:42AM +1100, Bruce Evans wrote: > Our Standard C namespace is a subset of the POSIX namespace. Most > Standard C headers are (were) careful about this. There aren't many > Standard C headers or versions of Standard C or large variations in the > versions, so this is relatively easy to do. > > We also attempt to use POSIX visibility ifdefs. This is not done so > carefully, and has more bugs due to more variations. But > does it fairly carefully. It has ifdefs for XSI, POSIX >= 2001, > any-POSIX (this is now very broken by unconditional declarations for > pthreads), POSIX >= 1995 (realtime POSIX stuff which I think was > standardized in POSIX.4 (.1b?) a couple of years before 1995, but we > don't have ifdefs for that), POSIX >= 2008 (psignal). That is just > in the top-level header. Almost half of that is only under XSI or > BSD, and it is quite likely that some newer or older POSIX or XSI > things are under the wrong ifdefed but are usually visible because > everything is visible by default. sys/signal.h has ifdefs for > POSIX >= 1993, more-delicate version ifdefs for XSI and POSIX <= 2001. > Most of the POSIX >= 1993 ifdefs are for realtime POSIX stuff. An > enormous number of definitions for things like trap codes for FP errors > are misplaced under the POSIX >= 1993 || XSI ifdef. These weren't in > POSIX.1-2006. This contrasts with the fine-grained ifdefs for signal > numbers. > > I find the ifdefs useful for seeing when POSIX introduced a feature > but not for actual use to compile under an old standard. So you are about the ANSI C & non-POSIX compilation environment ? Do you mean the following: diff --git a/include/signal.h b/include/signal.h index 33be55c..31cded7 100644 --- a/include/signal.h +++ b/include/signal.h @@ -36,8 +36,10 @@ #include #include #include +#if __POSIX_VISIBLE || __XSI_VISIBLE #include #include +#endif #if __BSD_VISIBLE /* I can change #if __POSIX_VISIBLE to some version cap, if you prefer.