mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: 'Proper' software writing
Date: Mon, 3 Sep 2012 21:50:04 -0400	[thread overview]
Message-ID: <20120904015004.GL27715@brightrain.aerifal.cx> (raw)
In-Reply-To: <5044B6E3.70203@palsenberg.com>

On Mon, Sep 03, 2012 at 03:55:47PM +0200, Igmar Palsenberg wrote:
> Hi,
> 
> When attempting to fix my own piece of software I've come to the
> conclusing that writing somewhat portable software (glibc vs musl) is a
> huge PITA.

Yes. Actually it's also a huge PITA between other implementations too,
but the breakage is all a lot more subtle. Basically the surest way to
write portable software is to use _POSIX_C_SOURCE or _XOPEN_SOURCE and
write purely to the standards, not using any extension functionality,
but often you want or even need at least some extensions that are
pretty much universally available, and then there's no well-defined
way to get them...

> - Why use _BSD_SOURCE and _GNU_SOURCE at all ? What is the argument of
> not exposing *ALL* stuff that is in musl ?

All is probably too much; there's a lot of ugly cruft (like lowercase
macros named major and minor getting exposed whenever you include
stdlib.h) in the "expose it all" _GNU_SOURCE profile. This is bad
enough if you're requesting it, but really bad if it's just there by
default.

I'm well aware that your frustration is the first/biggest FAQ people
have when trying to use musl and that it's a bad first experience.
Right now there's a big ongoing thread about what to do about it, and
we're doing some research on applications and the headers themselves
to figure out what a sane, clean, default profile to expose would be.

> - Is there a way to do proper feature detection ? I tried autoscan from
> autotools, but the outcome wanted to make me cry. It missed about all
>    that is important.

Gregor has a really good guide to using autotools properly, and some
tricks to make generated autoconf scripts lighter/faster by
dummying-out useless ones:

https://bitbucket.org/GregorR/autoconf-lean

Rich


  parent reply	other threads:[~2012-09-04  1:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-03 13:55 Igmar Palsenberg
2012-09-03 14:32 ` Szabolcs Nagy
2012-09-04  1:50 ` Rich Felker [this message]
2012-09-04  9:41   ` Igmar Palsenberg
2012-09-04 11:18     ` Igmar Palsenberg
2012-09-04 13:32     ` 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=20120904015004.GL27715@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).