delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/05/17/02:47:47

Date: Wed, 17 May 2000 10:19:47 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Laurynas Biveinis <lauras AT softhome DOT net>
cc: DJGPP Workers <djgpp-workers AT delorie DOT com>
Subject: Re: Minor GCC & DJGPP header problem
In-Reply-To: <39219CC4.EC6D90A@softhome.net>
Message-ID: <Pine.SUN.3.91.1000517101928.4709F-100000@is>
MIME-Version: 1.0
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

On Tue, 16 May 2000, Laurynas Biveinis wrote:

> I see two solutions:
> 1) as it is done with NULL in stdio.h:
> #undef offsetof
> #define offsetof we_dont_care_about_previous_def
> 
> 2) as gcc does
> #ifndef offsetof
> #define offsetof we_care_about_previous_def
> #endif
> 
> Which one (or noone) is OK?

IMHO, the former.  In this particular case, the two definitions are
identical, but it might not always be like that.

DJ?

Note that this is becoming ridiculous: do we really need to #undef
each macro before defining it, just to pacify GCC's invasive
practices?  These are _system_ headers, for crying out loud!  A
library implementation should be free to define these macros in any
way it sees fit without fear.

Why does GCC need to define offsetof, anyway?  And why can't it
include the system header where it should be defined according to
ANSI, *before* using its own definition?  If it did that, the ifndef
thing inside GCC's header would do the Right Thing.

- Raw text -


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