From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11055 invoked by alias); 19 Feb 2003 19:56:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 11032 invoked by uid 71); 19 Feb 2003 19:56:01 -0000 Resent-Date: 19 Feb 2003 19:56:01 -0000 Resent-Message-ID: <20030219195601.11031.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, stephen.kennedy@havok.com Received: (qmail 10978 invoked from network); 19 Feb 2003 19:55:32 -0000 Received: from unknown (HELO havok.com) (62.221.5.114) by 172.16.49.205 with SMTP; 19 Feb 2003 19:55:32 -0000 Received: (qmail 16869 invoked by uid 104); 19 Feb 2003 20:04:51 -0000 Received: from stephen@havok.com by static-143.telekinesys.com with qmail-scanner-0.96 (sweep: 2.10/3.61. . Clean. Processed in 2.316386 secs); 19 Feb 2003 20:04:51 -0000 Received: from stag.telekinesys (10.55.76.217) by mail.telekinesys with SMTP; 19 Feb 2003 20:04:49 -0000 Received: from stephen by stag.telekinesys with local (Exim 3.35 #1 (Debian)) id 18laKe-0005IG-00; Wed, 19 Feb 2003 19:56:40 +0000 Message-Id: Date: Wed, 19 Feb 2003 19:56:00 -0000 From: stephen.kennedy@havok.com To: gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org X-Send-Pr-Version: 3.113 Subject: c/9762: Address of 'char' is incorrect. X-SW-Source: 2003-02/txt/msg00952.txt.bz2 List-Id: >Number: 9762 >Category: c >Synopsis: Address of 'char' is incorrect. >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Wed Feb 19 19:56:01 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Stephen Kennedy >Release: 3.2.3 20030210 (Debian prerelease) (Debian testing/unstable) >Organization: Telekinesys Research >Environment: System: Linux stag 2.4.19-686 #1 Thu Aug 8 21:30:09 EST 2002 i686 unknown Architecture: i686 host: i386-pc-linux-gnu build: i386-pc-linux-gnu target: i386-pc-linux-gnu configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,pascal,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-java-gc=boehm --enable-objc-gc i386-linux >Description: In the example below, '&a' is the address of a local copy of 'a' not of 'a'. if the type of 'a' is changed to int, it works as expected. >How-To-Repeat: #define TA char #define TB int #define TC int void foobar(TA a, TB b, TC c); int main() { foobar(1,2,3); return 0; } void foobar(TA a, TB b, TC c) { printf("a == %i claims %x\n", a, &a); printf("a == %i really %x\n", (&b)[-1], (&b)-1); printf("b == %i %x\n", b, &b); printf("c == %i %x\n", c, &c); } >Fix: >Release-Note: >Audit-Trail: >Unformatted: