|
Message-ID: <20120908080734.7e1bbf57@newbook> Date: Sat, 8 Sep 2012 08:07:34 -0700 From: Isaac Dunham <idunham@...abit.com> To: musl@...ts.openwall.com Subject: Re: documenting musl 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. > >
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.