这不是bug。。。
时间: 2016-02-17来源:开源中国
前景提要
HDC调试需求开发(15万预算),能者速来!>>>
这不是bug。。。


nbz@bogon 1]$ ls
a.cc
[nbz@bogon 1]$ cat -n a.cc
1 #include <iostream>
2 class myint { char m1[7]; };
3 main(){ myint i1, &i2 = i1;
4 std::cout << sizeof i2 << std::endl;
5 return sizeof i2;
6 }
[nbz@bogon 1]$ make a CXXFLAGS=-g
g++ -g a.cc -o a
[nbz@bogon 1]$ ./a
7
[nbz@bogon 1]$ gdb a
Reading symbols from /tmp/1/a...done.
(gdb) b main
Note: breakpoint 1 also set at pc 0x4007ec.
Breakpoint 1 at 0x4007ec: file a.cc, line 3. (2 locations)
(gdb) r
Starting program: /tmp/1/a

Breakpoint 1, main () at a.cc:3
3 main(){ myint i1, &i2 = i1;
(gdb) p sizeof i2
$1 = 8
(gdb)

科技资讯:

科技学院:

科技百科:

科技书籍:

网站大全:

软件大全:

热门排行