This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14079] New: wrong debug info for extern boolean variable in debug mode
- From: "gcc-bugzilla at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Feb 2004 10:01:12 -0000
- Subject: [Bug c++/14079] New: wrong debug info for extern boolean variable in debug mode
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Compile a program attached in how-to-repeat section with
c++ -g -ggdb foo.cc
Run it in gdb. Exec:
b main
p sizeof(bool)
p sizeof(foo)
p sizeof(bar)
p &foo
p &bar
set foo=1
set bar=0
set foo=1
Note, that nevertheless pritnf() output is correct.
Environment:
System: Linux oak 2.4.21-99-athlon #1 Wed Sep 24 13:34:32 UTC 2003 i686 athlon i386 GNU/Linux
Architecture: i686
OS: SuSE Linux 9.0, GNU gdb 5.3.92 from default package. Note, that the bug
reproduces on the other developers SuSE 9.0 boxes, having earlier versions of
GCC.
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc-3.3.2/configure --enable-threads=posix --enable-languages=c,c++
How-To-Repeat:
-- cut (foo.cc)
#include <stdio.h>
extern bool foo;
bool foo, bar;
int main()
{
printf("%d, %d, %d\n", sizeof(bool), sizeof(foo), sizeof(bar));
}
-- end cut
------- Additional Comments From konstantin at mysql dot com 2004-02-09 10:01 -------
Fix:
Work around is not use bool if bool is extern, because they are not
operable in debug mode.
--
Summary: wrong debug info for extern boolean variable in debug
mode
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: konstantin at mysql dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14079