delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2012/09/02/16:04:14

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
X-Recipient: djgpp-workers AT delorie DOT com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:content-type;
bh=RHFJ5VyUm2Hv/cqnQ8OmIW15T2SFZca4iJHpaJPzEw0=;
b=pwoaI2BasZP1zP5hFpf0llOR0RibS5CLgwf0HWCbFxuKLzvmOCf5gjnIvCRSoyTvpO
5r3/U/pqR8aTJgERxLDo9iZj1KRQHfeNUTMdejluf0jQ19jr/mlM34Dhs2jLfjGaov3b
Dy6kIUjkXiIZZ+NfO+WM75tYf/uuNm+PD4WpvZy7A+5zMB9slx4DRm9FDfEVd4IDz7Fo
Ee+Q1PxlaMdsRG/LxuJ6QRO3NgJ6NwvGKC10U0GfzInys3y+gqqKwoNzYjtpLycESnn1
RsX1SgGuoLWvnZXOd8EtDTSESeESktC8ao31y1GCKNY+Ul5jmSmAlka4h5yRT41TJzLv
t+ag==
MIME-Version: 1.0
In-Reply-To: <CAA-ihx-+juCuiapWVXVbJK5gWA-5NOd-idVGTXH93DNtaGN=Xg@mail.gmail.com>
References: <CAA-ihx-+juCuiapWVXVbJK5gWA-5NOd-idVGTXH93DNtaGN=Xg AT mail DOT gmail DOT com>
Date: Sun, 2 Sep 2012 14:35:22 -0500
Message-ID: <CAA-ihx9e5upk6kwNBoufOwBFweJ6-wTODyy8G9N-ftRgDfm_Yg@mail.gmail.com>
Subject: Re: memalign() -- backwards to Linux
From: Rugxulo <rugxulo AT gmail DOT com>
To: djgpp-workers AT delorie DOT com
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Hi again,

On Tue, Aug 28, 2012 at 6:13 PM, Rugxulo <rugxulo AT gmail DOT com> wrote:
>
>    I hate to mention this, I know it's not that important ...
>
> I read a while back that DJGPP's memalign() is backwards to Linux
>
> void *memalign(size_t size, size_t alignment); // DJGPP
> void *memalign(size_t alignment, size_t size); // Linux
>
> ANSI/ISO C   No
> POSIX          No
>
> Even if you don't find this that big a deal, wouldn't it be better to
> use #warning or similar on this (and other things like fork) so that
> nobody gets the wrong idea???

Apparently the Linux version is in malloc.h while ours is in stdlib.h
(probably a bad place, IMHO). But how would you (only) warn (at
compile time) when including stdlib.h without being annoying to
everybody?

Well, I (weakly) propose moving it out of stdlib and putting it
exclusively in malloc. (And presumably fixing it to match Linux, of
course.) It seems 2.04's malloc.h is pure boilerplate, does nothing
but include stdlib.h anyways, so it wouldn't hurt much there.

http://www.delorie.com/bin/cvsweb.cgi/djgpp/include/malloc.h

Then people would have to know to include malloc.h anyways. Actually,
if you fix it to match Linux, it probably doesn't need a #warning
anyways! (I know #warning isn't ANSI, but GCC does support it. I
guess?? you could instead do #pragma warning , but I don't know
offhand if that works with GCC.)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019