From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/1888 Path: news.gmane.org!not-for-mail From: Isaac Dunham Newsgroups: gmane.linux.lib.musl.general Subject: Re: documenting musl Date: Sat, 8 Sep 2012 08:07:34 -0700 Message-ID: <20120908080734.7e1bbf57@newbook> References: <20120908024006.GA5937@brightrain.aerifal.cx> <20120907233658.2eb8ee1a@newbook> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1347116874 25617 80.91.229.3 (8 Sep 2012 15:07:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Sep 2012 15:07:54 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-1889-gllmg-musl=m.gmane.org@lists.openwall.com Sat Sep 08 17:07:56 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 1TAMdV-0000X5-5V for gllmg-musl@plane.gmane.org; Sat, 08 Sep 2012 17:07:53 +0200 Original-Received: (qmail 1825 invoked by uid 550); 8 Sep 2012 15:07:49 -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 1817 invoked from network); 8 Sep 2012 15:07:49 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=lavabit; d=lavabit.com; b=BJrfbnPSE9RiLaL2JI+/JW/PILpZtpS/YO2HZcbNasVu7/Gkc/vtlp0A2UN3P5+q2eBA+4TUEQH7zcxaOqxlRiL8hKUTlhN483lFJwX1afAbUwY4TF8TqQM/pbd+hLi4zjrshtjThz/Ea91KHh5+GfU4KQ+qKyrQEZcGuQawy7Y=; h=Date:From:To:Subject:Message-ID:In-Reply-To:References:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding; In-Reply-To: <20120907233658.2eb8ee1a@newbook> X-Mailer: Claws Mail 3.7.4 (GTK+ 2.20.1; i486-pc-linux-gnu) Xref: news.gmane.org gmane.linux.lib.musl.general:1888 Archived-At: 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. > >