mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: compatability: bits/syscall.h requires C99
Date: Thu, 23 Aug 2012 22:07:49 -0400	[thread overview]
Message-ID: <20120824020749.GU27715@brightrain.aerifal.cx> (raw)
In-Reply-To: <20120823172519.39f899b6@newbook>

On Thu, Aug 23, 2012 at 05:25:19PM -0700, Isaac Dunham wrote:
> On Thu, 23 Aug 2012 08:34:53 -0400
> Rich Felker <dalias@aerifal.cx> 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


  reply	other threads:[~2012-08-24  2:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-23  5:07 idunham
2012-08-23  6:11 ` [PATCH] Problem is static inline idunham
2012-08-23  6:20   ` [PATCH 2/1] " idunham
2012-08-23  6:43     ` Szabolcs Nagy
2012-08-23  6:51   ` [PATCH] " Szabolcs Nagy
2012-08-23 12:18   ` Rich Felker
2012-08-23 12:31 ` compatability: bits/syscall.h requires C99 John Spencer
2012-08-23 12:34   ` Rich Felker
2012-08-24  0:25     ` Isaac Dunham
2012-08-24  2:07       ` Rich Felker [this message]
2012-08-24  2:34         ` Rich Felker
2012-08-24  3:31           ` [PATCH/RFC] __inline for C89 compilers (take 3?) Isaac Dunham
2012-08-24  7:53           ` compatability: bits/syscall.h requires C99 Szabolcs Nagy
2012-08-30 22:45             ` [PATCH/RFC] inline cleanup/C89 support Isaac Dunham
2012-08-31  8:34               ` Szabolcs Nagy
2012-08-31 19:27                 ` Isaac Dunham
2012-09-02 16:51               ` Rich Felker
2012-09-04 15:49                 ` philomath
2012-09-04 17:44                   ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120824020749.GU27715@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).