From: Isaac Dunham <idunham@lavabit.com>
To: musl@lists.openwall.com
Subject: Re: documenting musl
Date: Sat, 8 Sep 2012 08:07:34 -0700 [thread overview]
Message-ID: <20120908080734.7e1bbf57@newbook> (raw)
In-Reply-To: <20120907233658.2eb8ee1a@newbook>
Hello everyone,
I'm glad to see all the helpful discussion about the proper source
format for documentation. :P
Any comments on the _documentation_, as opposed to what format I'm
thinking about putting it into when I think it's ready?
(quoting it did mess up the text formatting, fyi: see the attachment to
my first post if you care.)
> The unofficial musl manual
>
> Feature test macros, standards:
> Musl supports the following standards, with the given feature test
> macros or parameters: X/Open 2008 (SUS4) _XOPEN_SOURCE >= 700
> POSIX 2008 _POSIX_C_SOURCE >= 200809L, _POSIX_SOURCE
> ISO C99 (requires -std=c99 or equivalent;
> detected using __STRICT_ANSI__, which gcc sets automatically)
>
> The following standards are partly supported:
> ISO C11 (WIP, threads and atomics aren't
> supported yet, and Annex K is unlikely to be supported in the
> foreseeable future; use -std=c11 or equivalent)
> ANSI C89/ISO C90 A few details are incompatible with C99, and
> the namespace respected is the C99 one. However, there
> shouldn't be breakage.
> Older POSIX and SUS _POSIX_C_SOURCE < 200809L, _XOPEN_SOURCE <
> 700 Exposes legacy extensions as well as the modern
> standard, rather than only the legacy
> standard.
>
> The following feature test macros are also supported to the extent
> practical: _GNU_SOURCE Partial glibc compatability.
> Nonstandard functions with the same names as
> standard ones (basename and several others) ARE NOT SUPPORTED:
> musl uses the ISO/POSIX/SUS definition
> unconditionally. _LARGEFILE64_SOURCE nop: musl only provides
> 64bit file io, so this just adds *64 aliases to the namespace
> _BSD_SOURCE While glibc is still stuck at BSD 4.4,
> musl provides much of the functionality available via _NETBSD_SOURCE
> on NetBSD. This includes strlcpy, strlcat,
> and fgetln.
>
> By default (-std=gnu* or no arguments for GCC), musl currently sets
> _XOPEN_SOURCE to 700 and defines _BSD_SOURCE.
> With musl 0.9.4 or older, musl defaulted to ANSI C99.
>
> Detecting musl:
> This is frequently asked about. It is not possible to detect musl for
> sure. Key differences:
> __linux and __ELF will both be defined, unlike with dietlibc.
> unistd.h defines _XOPEN_VERSION to 700 and _POSIX_VERSION to 200809L.
> (This is what you should be checking for, unless you need nonstandard
> functions) features.h defaults to defining _BSD_SOURCE and
> _XOPEN_SOURCE, rather than _BSD_SOURCE and _SVID_SOURCE; __USE_*
> macros are not present, nor are the __GLIBC* macros. Using GNU
> basename syntax ( basename("/usr"); ) will make for segfaults.
>
>
next prev parent reply other threads:[~2012-09-08 15:07 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-08 2:40 Rich Felker
2012-09-08 6:36 ` Isaac Dunham
2012-09-08 8:44 ` Daniel Cegiełka
2012-09-08 11:48 ` Kurt H Maier
2012-09-08 12:35 ` Daniel Cegiełka
2012-09-08 12:46 ` Rich Felker
2012-09-08 12:53 ` Daniel Cegiełka
2012-09-08 12:47 ` Kurt H Maier
2012-09-08 13:12 ` Daniel Cegiełka
2012-09-08 13:16 ` Kurt H Maier
2012-09-08 13:42 ` Daniel Cegiełka
2012-09-08 14:09 ` Kurt H Maier
2012-09-09 1:43 ` John Spencer
2012-09-08 14:24 ` Isaac Dunham
2012-09-08 15:07 ` Isaac Dunham [this message]
2012-09-08 19:46 ` Szabolcs Nagy
2012-09-08 11:44 ` Justin Cormack
2012-09-08 14:53 ` Isaac Dunham
2012-09-09 3:09 ` nwmcsween
2012-09-09 4:15 ` Rich Felker
2012-09-09 4:15 ` nwmcsween
2012-09-09 6:12 ` Rich Felker
2012-09-09 8:04 ` Justin Cormack
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=20120908080734.7e1bbf57@newbook \
--to=idunham@lavabit.com \
--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).