[Bug target/80777] gdb sizeof(long int)=4 but gcc sizeof(long int)=8 on x86_64-pc-cygwin

jrose.manila at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu May 18 03:43:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80777

--- Comment #5 from Julian Rose <jrose.manila at gmail dot com> ---
https://bugzilla.redhat.com/show_bug.cgi?id=518712 describes the same issue
under Linux. But repeating the same test described in comment-1 there when run
under x86_64-pc-cygwin gets the wrong answer:

$ gdb
GNU gdb (GDB) (Cygwin 7.10.1-1) 7.10.1
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-cygwin".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) show arch
The target architecture is set automatically (currently i386)
(gdb) set arch
Requires an argument. Valid arguments are i386, i386:x86-64, i386:x64-32,
i8086, i386:intel, i386:x86-64:intel, i386:x64-32:intel, i386:nacl,
i386:x86-64:nacl, i386:x64-32:nacl, auto.
(gdb) set arch i386:x86-64
The target architecture is assumed to be i386:x86-64
(gdb) print sizeof(long)
$1 = 4
(gdb) print sizeof(long long)
$2 = 8
(gdb) print sizeof(long*)
$3 = 8
(gdb) q


More information about the Gcc-bugs mailing list