[Bug debug/80263] gcc's internal type "sizetype" leaks out as base type name in the DWARF info
palves at redhat dot com
gcc-bugzilla@gcc.gnu.org
Thu Mar 30 13:47:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80263
--- Comment #1 from Pedro Alves <palves at redhat dot com> ---
The consequence is that that internal type's name can mask out a user-defined
type with the same name. For example:
$ cat sizetype2.c
char array[1];
typedef struct sizetype { char c; } sizetype;
sizetype sz;
int main () {}
$ /opt/gcc/bin/gcc sizetype2.c -o sizetype2 -g
$ gdb ./sizetype2
(gdb) start
Temporary breakpoint 1, main () at sizetype2.c:4
4 int main () {}
(gdb) ptype sz
type = struct sizetype {
char c;
}
(gdb) ptype sizetype
type = sizetype
(gdb)
The last "ptype" above should have printed out the structure type. Instead, it
printed GCC's "sizetype" integer type.
More information about the Gcc-bugs
mailing list