FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian GCC

 
 
LinkBack Thread Tools
 
Old 04-13-2012, 06:59 AM
Teodor
 
Default Bug#668581: gcc-4.6: scanf() wrong read on 08 09 integers

Package: gcc-4.6
Version: 4.6.3-3
Severity: normal

Hi,

I was debugging a more complex problem and noticed that not all
input values were read. Further inspection showed that input
integers "08" and "09" (read from a file) were not correctly
recognised by fscanf() as two integers (8 and 9) but as four
integers (0 8 0 9). I've attached a minimal test C program
and a test file. After compile execute:
$ ./tscanf0809 < tscanf0809.txt

Thanks


-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=ro_RO.utf8, LC_CTYPE=ro_RO.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages gcc-4.6 depends on:
ii binutils 2.22-6
ii cpp-4.6 4.6.3-3
ii gcc-4.6-base 4.6.3-3
ii libc6 2.13-27
ii libgcc1 1:4.7.0-3
ii libgmp10 2:5.0.4+dfsg-1
ii libgomp1 4.7.0-3
ii libmpc2 0.9-4
ii libmpfr4 3.1.0-4
ii libquadmath0 4.7.0-3
ii zlib1g 1:1.2.6.dfsg-2

Versions of packages gcc-4.6 recommends:
ii libc6-dev 2.13-27

Versions of packages gcc-4.6 suggests:
pn binutils-gold <none>
pn gcc-4.6-doc <none>
pn gcc-4.6-locales 4.6.3-3
pn gcc-4.6-multilib <none>
pn libgcc1-dbg 1:4.7.0-3
pn libgomp1-dbg <none>
pn libmudflap0-4.6-dev <none>
pn libmudflap0-dbg <none>
pn libquadmath0-dbg <none>

-- no debconf information
01
02
03
04
05
06
07
08
09
10

01 02 03 04 05 06 07 08 09 10
 
Old 04-13-2012, 08:14 AM
Gabriel Paubert
 
Default Bug#668581: gcc-4.6: scanf() wrong read on 08 09 integers

On Fri, Apr 13, 2012 at 09:59:11AM +0300, Teodor wrote:
> Package: gcc-4.6
> Version: 4.6.3-3
> Severity: normal
>
> Hi,
>
> I was debugging a more complex problem and noticed that not all
> input values were read. Further inspection showed that input
> integers "08" and "09" (read from a file) were not correctly
> recognised by fscanf() as two integers (8 and 9) but as four
> integers (0 8 0 9). I've attached a minimal test C program
> and a test file. After compile execute:
> $ ./tscanf0809 < tscanf0809.txt

It's not a bug, read the documentation about scanf and
the difference between %d and %i, which attempts to read
a number represented in octal with your input.

Gabriel



--
To UNSUBSCRIBE, email to debian-gcc-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120413081453.GB11716@visitor2.iram.es">http://lists.debian.org/20120413081453.GB11716@visitor2.iram.es
 

Thread Tools




All times are GMT. The time now is 01:04 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org