c++/9881: Incorrect address calculation for static class member
asharji@uwaterloo.ca
asharji@uwaterloo.ca
Thu Feb 27 18:06:00 GMT 2003
>Number: 9881
>Category: c++
>Synopsis: Incorrect address calculation for static class member
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Feb 27 18:06:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: asharji@uwaterloo.ca
>Release: 3.3 20030224 (prerelease)
>Organization:
>Environment:
System: Linux awk.math 2.4.18-bf2.4 #1 Son Apr 14 09:53:28 CEST 2002 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc-20030224/configure --prefix=/u/asharji/gcc/gcc20030224/ --enable-languages=c,c++,objc --enable-threads=posix
>Description:
The calculation for:
double *module::b = &(((bar *)&module::storage)->p);
is incorrect and should be done at compile time.
In terms of the output, the second value printed should not be
0.
>How-To-Repeat:
g++ calcbug2.cc
./a.out
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="calcbug2.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="calcbug2.cc"
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlOjpzdGQ7CgpzdHJ1Y3QgYmFyIHsK
ICAgIGRvdWJsZSBwOwp9OyAvLyBiYXIKCnN0cnVjdCBtb2R1bGUgewogICAgc3RhdGljIGRvdWJs
ZSAqYjsKICAgIHN0YXRpYyBkb3VibGUgc3RvcmFnZTsKfTsKCmNsYXNzIGZvbyB7CiAgcHVibGlj
OgogICAgZm9vKCkgewoJLy8gdGhlIG91dHB1dCBmb3IgYm90aCB2YWx1ZXMgc2hvdWxkIGJlIHRo
ZSBzYW1lCgljb3V0IDw8ICZtb2R1bGU6OnN0b3JhZ2UgPDwgIiAiIDw8IG1vZHVsZTo6YiA8PCBl
bmRsOwogICAgfQp9OwoKZm9vIGY7IC8vIHByaW50IG91dHB1dAoKZG91YmxlICptb2R1bGU6OmIg
PSAmKCgoYmFyICopJm1vZHVsZTo6c3RvcmFnZSktPnApOyAvLyBzaG91bGQgYmUgYSBjb21waWxl
LXRpbWUgY2FsY3VsYXRpb24KZG91YmxlIG1vZHVsZTo6c3RvcmFnZSA9IDAuMDsKCmludCBtYWlu
KCkgewp9Cg==
More information about the Gcc-bugs
mailing list