From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22792 invoked by alias); 12 Jun 2003 16:35:56 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 22703 invoked from network); 12 Jun 2003 16:35:53 -0000 Received: from unknown (HELO l3.iga-gmbh.de) (212.117.77.118) by sources.redhat.com with SMTP; 12 Jun 2003 16:35:53 -0000 Received: from lutz.iga-gmbh.de (lutz.iga-gmbh.de [172.16.1.25]) by l3.iga-gmbh.de (8.11.6/8.10.2/SuSE Linux 8.10.0-0.3) with SMTP id h5CGZqi30296 for ; Thu, 12 Jun 2003 18:35:52 +0200 Received: by lutz.iga-gmbh.de with Microsoft Mail id <01C33111.630DF510@lutz.iga-gmbh.de>; Thu, 12 Jun 2003 18:35:24 +0200 Message-ID: <01C33111.630DF510@lutz.iga-gmbh.de> From: LN To: "'gcc-bugs@gcc.gnu.org'" Subject: Bug report Date: Thu, 12 Jun 2003 16:35:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-SW-Source: 2003-06/txt/msg01477.txt.bz2 List-Id: Dear GNUs... I think that I have found a bug when compiling the macro 'offsetof' for example struct TYPE { int MEMBER; int MEMBER2; }; offsetof (TYPE,MEMBER) allways raises warning: invalid access to non-static data member 'TYPE::MEMBER' of NULL Object warning: perhaps the 'offsetof' macro was uses incorrectly a workaround is to change the declaration in stddef.h changing the NULL-pointer to a NOT NULL address: #define offsetof(TYPE, MEMBER) (((size_t) &((TYPE *)8)->MEMBER)-8) If you think that checking for NULL pointers is usefull and necessary at this point, you should fix that workaround in stddef.h or implement the 'offsetof' macro as a real C++ operator. with best regards Lutz Nitzsche