From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/1707 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: compatability: bits/syscall.h requires C99 Date: Thu, 23 Aug 2012 22:07:49 -0400 Message-ID: <20120824020749.GU27715@brightrain.aerifal.cx> References: <12609.132.241.65.179.1345698455.squirrel@lavabit.com> <503622B4.8020506@barfooze.de> <20120823123453.GO27715@brightrain.aerifal.cx> <20120823172519.39f899b6@newbook> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1345773977 29504 80.91.229.3 (24 Aug 2012 02:06:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Aug 2012 02:06:17 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-1708-gllmg-musl=m.gmane.org@lists.openwall.com Fri Aug 24 04:06:18 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1T4jHs-0006Op-RH for gllmg-musl@plane.gmane.org; Fri, 24 Aug 2012 04:06:16 +0200 Original-Received: (qmail 22506 invoked by uid 550); 24 Aug 2012 02:06:14 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 22498 invoked from network); 24 Aug 2012 02:06:14 -0000 Content-Disposition: inline In-Reply-To: <20120823172519.39f899b6@newbook> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:1707 Archived-At: On Thu, Aug 23, 2012 at 05:25:19PM -0700, Isaac Dunham wrote: > On Thu, 23 Aug 2012 08:34:53 -0400 > Rich Felker wrote: > > > On Thu, Aug 23, 2012 at 02:31:48PM +0200, John Spencer wrote: > > > On 08/23/2012 07:07 AM, idunham@lavabit.com wrote: > > > >Upstream insists on using --std=c89 > > > insisting on c89 sounds really stupid. > > > > Agreed. This does not improve compatibility; it breaks compatibility, > > especially if they happen to #include any third-party library header > > which is not _documented_ as being c89 compatible. (Even if it happens > > to work with -std=c89 now, unless it's documented that it does and > > always will, this might change in a future version.) > > 1- Per grep, they don't use third-party headers. > > 2- I believe the point is prevent breaking C89 platforms, by making > non-C89 code FTBFS anywhere. Since they build-test every pull request > automatically, there's little chance of non-C89 code getting merged. I still think this is really bad policy, akin to the bad policy in GNU binutils of putting -Werror in their CFLAGS. You never know when strict/pedantic/Werror/etc. type options will raise an issue on end user systems that causes the build to break. Strict options should only be turned on in their test environment, not in the default configuration shipped to users. > macros available in different modes > (courtesy of gcc -E -dM - < /dev/null ): Thanks! > So putting ~ this at the top of the header should work > (not verbatim, just the general concept!): > #if !(__STDC_VERSION__ >= 199901L) && __STRICT_ANSI__ > #define inline __inline > #define restrict /* fallback for C89 compilers */ > #endif This won't work for restrict. Unlike inline, restrict is not recognized even in non-strict mode unless __STDC_VERSION__ is >=C99. > OTOH, s/inline/__inline/g is probably better/more universal, since > __inline is supported on some alternate compilers. No, that reduces musl's public interface from portable C99 to compiler-specific crap. Rich