From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2553 Path: news.gmane.org!not-for-mail From: Rob Landley Newsgroups: gmane.linux.lib.musl.general Subject: Re: NULL Date: Sat, 12 Jan 2013 00:32:44 -0600 Message-ID: <1357972364.32505.4@driftwood> References: <50ED726B.7010201@barfooze.de> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; DelSp=Yes; Format=Flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1357972384 29241 80.91.229.3 (12 Jan 2013 06:33:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 12 Jan 2013 06:33:04 +0000 (UTC) Cc: musl@lists.openwall.com To: musl@lists.openwall.com Original-X-From: musl-return-2554-gllmg-musl=m.gmane.org@lists.openwall.com Sat Jan 12 07:33:22 2013 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 1TtueZ-0002Gd-QE for gllmg-musl@plane.gmane.org; Sat, 12 Jan 2013 07:33:15 +0100 Original-Received: (qmail 17631 invoked by uid 550); 12 Jan 2013 06:32:59 -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 17623 invoked from network); 12 Jan 2013 06:32:59 -0000 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:date:from:subject:to:cc:in-reply-to:x-mailer:message-id :mime-version:content-type:content-disposition :content-transfer-encoding:x-gm-message-state; bh=T4izko9JfSoYxO/2wmed+XEwa3tvrqThRuafxL+9sIE=; b=EqA8d0/bipbF/rFtURGvY82C5NyQBgACOJCJ/KrNI44JCFLR10KGMKcNhfWQ13IjKQ WU1Vsbc28iEoW7dhpINrCPF3CE09x+QvpU2kHcfthGsKZbK0mM6vxpbtHUolsqGIpV1G dCcKPCSRnCDYXgXtSThDer2m+DHQPfR/FcqeX7j8pUmnM0tbmsDwJlzrQVcywq9HdYdA RLZRsFvdVutzCtrfZAjOdggWTKcAgoxjX029w2SaPSU9mmIn996K14VkY5QYQASZGw7z TKBkt4X6AQw1EScPuoBAQQ0+7s/0E+soVBnZFK7GO7sLQHTtKgBPVK6LhGdjObWIxY3Z /n5w== X-Received: by 10.182.69.36 with SMTP id b4mr55782159obu.96.1357972367354; Fri, 11 Jan 2013 22:32:47 -0800 (PST) In-Reply-To: <50ED726B.7010201@barfooze.de> (from maillist-musl@barfooze.de on Wed Jan 9 07:36:43 2013) X-Mailer: Balsa 2.4.11 Content-Disposition: inline X-Gm-Message-State: ALoCoQnTCG17UjdjyrzBQ7xo8xtdlt78OZ3xkWNiZ4vBbY36E0RszvD8YtRv9CzhcofRTx8lK6Js Xref: news.gmane.org gmane.linux.lib.musl.general:2553 Archived-At: On 01/09/2013 07:36:43 AM, John Spencer wrote: >> using NULL in the argument of variadic functions is ub both >> in c and c++ >=20 > many developers don't care about the standard. they take the stance: > "works for me, if you want it patched then do it yourself and we'll =20 > eventually merge" Why is it UB? The standard says it's a pointer. If you pull %p off in =20 printf, feeding NULL in that slot should work fine. > yes, once you know the details, it's easy to fix. > but when you don't, you'll have a hard time figuring out where the =20 > segfault comes > from. i agree that this should get more publicity. "C++ is hard to debug and requires you to know how nested template =20 expansion gets implemented down to the bare metal" is not a new problem. Programming in C++ and hitting seemingly-trivial problems you can't =20 debug without reading the compiler's source code is like riding a =20 motorcyle and wind up with maimed for life. (There's a reason medical =20 personnel call them "donorcycles".) >> i think this is not needed, you can have a definition >> in c++ that "happens to work" just like the (void*)0 >> in c: >>=20 >> #define NULL 0L >=20 > yes, that'll work as well. >=20 >> but this is just a workaround, the bugs still need to be fixed It's not a workaround, it's what C99+LP64 explicitly specifies. If doing something well-defined in C99 on Linux goes nuts on C++ in =20 Windows, how is this our problem? >> (in c++11 we could use nullptr which has std::nullptr_t type >> which converts to (void*)0 in vararg context, but c++11 is not >> widely used yet) Is there actually a point to the C++1!!1one! standard? The only person =20 I've heard actually be happy with it is the author of uClibc++, but he =20 liked the previous C++ standards and thinks Corba is a good idea, so... > well, from what i heard on IRC they started to work on a musl port 2 =20 > weeks ago (but > it got silent since...). since they have likely more packages than =20 > sabotage (350) > this issue could cause them major pain. I wouldn't be too impressed by this. There are somewhere between 200 and 900 packages that cross compile =20 "easily", for a decreasingly obvious definition of "easily" depending =20 on how many rocket engines you want to strap to the turtle. Projects =20 like OpenEmbedded and Beyond Linux From Scratch recapitulate phylogeny =20 with these packages, and then hit the point where your volunteers' time =20 is entirely consumed dealing with package upgrades to hold the existing =20 turf against bit-rot. (Personally, I refer to this as "the buildroot =20 event horizon".) Actual distributions eventually separate "the OS" from "the =20 repository", where they have a core team who does work on the operating =20 system and a separate (much, much larger) set of package maintainers =20 who keep their packages of interest working but don't generally work on =20 the base OS other than complaining when something breaks. You only get to the "real distro" stage when the base OS stops being =20 interesting. While the base OS remains a moving target, package =20 maintainers can't do their jobs without also being OS maintainers, =20 which is a much bigger time commitment and has Brooks' Law problems =20 with coordination overhead scaling your core team. There are plenty of existing interesting repositories: Debian, Ubuntu, =20 Red Hat, SuSE, Gentoo... How much work do they do maintaining those =20 repos? According to https://admin.fedoraproject.org/pkgdb/stats/?_csrf_token=3D1048fa94db94990f= 5c39ed12c7ca4cd8cb840ca7 =20 Fedora has 150,000 packages (but then they break packages into several =20 smaller packages for no apparent reason, and this may treat x86 and =20 i686 versions of the same thing as separate packages). A much cleaner =20 reading is "wget =20 http://packages.debian.org/stable/allpackages?format=3Dtxt.gz -O - | zcat =20 | wc -l" which gives around 35,000 packages. (You can get larger =20 numbers by checking what ubuntu adds, looking at testing instead of =20 stable, adding in the external repositories that debian's =20 ultraconservative definition of "proprietary" kicks stuff to, and so =20 on. But this is a good ballpark.) A more recent attempt at being a real boy distro would =20 be Arch Linux, and =20 https://www.archlinux.org/packages/?sort=3D&arch=3Di686&q=3D&maintainer=3D&= last_update=3D&flagged=3D&limit=3D50 =20 finds 4300 packages for the i686 target, and they've been doing this =20 since 2002. Reinventing the wheel because you have a new libc: not very =20 interesting. Trying to get a musl version of debian or gentoo that you =20 can push "upstream": a lot more interesting. Rob=