This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/15934] New: scanf() conversion %i incorrectly reads unsigned hex values
- From: "relf at os2 dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Jun 2004 07:10:57 -0000
- Subject: [Bug c/15934] New: scanf() conversion %i incorrectly reads unsigned hex values
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following program reads 0xF1234567 as 0x7fffffff:
#include <stdio.h>
int main() {
char* s = "0xF1234567";
unsigned int x;
sscanf(s,"%i",&x);
printf("Got: 0x%08x\n",x);
return 0;
}
--
Summary: scanf() conversion %i incorrectly reads unsigned hex
values
Product: gcc
Version: 3.3.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: relf at os2 dot ru
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15934