This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug c++/16687] GDB Reports Incorrect Hexadecimal Value when adding floats
- From: "huguesdelassus at hotmail dot fr" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Mon, 18 Apr 2016 13:59:28 +0000
- Subject: [Bug c++/16687] GDB Reports Incorrect Hexadecimal Value when adding floats
- Auto-submitted: auto-generated
- References: <bug-16687-4717 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=16687
Hugues de Lassus Saint-GeniÃs <huguesdelassus at hotmail dot fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |huguesdelassus at hotmail dot fr
--- Comment #1 from Hugues de Lassus Saint-GeniÃs <huguesdelassus at hotmail dot fr> ---
This bug is very closely related to bug 15318, if not a duplicate.
0x4d8ef3c2 is the integer representing the IEEE-754 binary32 value 299792448,
which is the binary32 number closest to 3.1415 + 299792458.
0x11de7840 is the hexadecimal representation of the integer value 299792448.
Without the -g flag, gdb has no idea that "value" is a float, and thus treats
it as a raw integer. That's exactly why it outputs 0x4d8ef3c2.
With -g enabled, "value" is known to be a floating-point datum, and that is why
p/x value first converts (float)299792448 to an integer, and then to the
hexadecimal value of this integer (which is 0x11de7840).
--
You are receiving this mail because:
You are on the CC list for the bug.