Date: Tue, 4 Sep 2012 09:32:15 -0400 From: Rich Felker <dalias@...ifal.cx> To: musl@...ts.openwall.com Subject: Re: 'Proper' software writing On Tue, Sep 04, 2012 at 11:41:18AM +0200, Igmar Palsenberg wrote: > On 9/4/12 3:50 AM, Rich Felker wrote: > > 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... > This code is Linux only. I basically can use _GNU_SOURCE, but that pulls > in way to much, and not to mention > things you don't want in decent software. For now, I've settled for > _XOPEN_SOURCE and _BSD_SOURCE, and redefine the stuff I need (dladdr(), > some network related defines). If dladdr is missing with _BSD_SOURCE, I think that's a bug in our headers. The FreeBSD man pages document it, so I think it should be included in the _BSD_SOURCE profile. I'm holding off on making any header changes right this moment because there's a HUGE pending patch to add correct C99 restrict keyword usage everywhere it belongs in musl, and changing the headers now would make extra work resolving conflicts, but I'll fix it soon. Rich
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.