[Bug 128355] Re: libc6 printf alternate format %#.g prints wrong number of digits

2011-05-25 Thread Bug Watch Updater
Launchpad has imported 6 comments from the remote bug at
http://sourceware.org/bugzilla/show_bug.cgi?id=4858.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.


On 2007-07-27T18:47:33+00:00 Wirawan Purwanto wrote:

Please use the following testcase:

#include stdio.h
int main(int argc, char *argv[], char *env[])
{
printf(%#.4g\n, 912.98);
return 0;
}

This code should print 913.0, but instead it only prints 913. . It lacks the
trailing zeros, which should be there according to the standard C specs.

I believe that this bug is reproducible on the stock version of glibc 2.6 . I
have established the bug by building the 2.6 library on my local machine, then
linking the program above against the newly built libc.a .

Reply at: https://bugs.launchpad.net/glibc/+bug/128355/comments/2


On 2007-07-27T20:10:07+00:00 Jakub Jelinek wrote:

This is a regression caused by the BZ#4070 fix, particularly the
+   else if (__builtin_expect (spec == 'g'  type == 'f'  info-alt,
+  0))
+ /* This is a special case: the rounded number is 1.0,
+the format is 'g' or 'G', and the alternative format
+is selected.  This means the result must be 1..  */
+ --added_zeros;
hunk.  It is IMHO only valid when the the integral part is all nines (or empty),
i.e. when we'll need more int digits, but we don't know this at this point.
For the %#.0g, 0.956 case which got fixes that is true and similarly for
%#.4g, 999.98, but not for this %#.4g, 912.98.

Reply at: https://bugs.launchpad.net/glibc/+bug/128355/comments/4


On 2007-07-29T00:26:36+00:00 Drepper-fsp wrote:

Fixed in cvs.

Reply at: https://bugs.launchpad.net/glibc/+bug/128355/comments/5


On 2007-07-31T02:06:08+00:00 Drepper-fsp wrote:

*** Bug 4869 has been marked as a duplicate of this bug. ***

Reply at: https://bugs.launchpad.net/glibc/+bug/128355/comments/7


On 2007-07-31T12:43:00+00:00 Cvs-commit wrote:

Subject: Bug 4858

CVSROOT:/cvs/glibc
Module name:libc
Branch: glibc-2_6-branch
Changes by: ja...@sourceware.org2007-07-31 12:42:39

Modified files:
.  : ChangeLog 
stdio-common   : printf_fp.c tfformat.c 

Log message:
2007-07-31  Jakub Jelinek  ja...@redhat.com

* stdio-common/tfformat.c (sprint_doubles): Add 12 new tests.

2007-07-28  Ulrich Drepper  drep...@redhat.com

[BZ #4858]
* stdio-common/printf_fp.c (___printf_fp): Fix special case of
#.0g and value rounded to 1.0.
* stdio-common/tfformat.c (sprint_doubles): Add two new tests.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/ChangeLog.diff?cvsroot=glibconly_with_tag=glibc-2_6-branchr1=1.10640.2.1r2=1.10640.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/stdio-common/printf_fp.c.diff?cvsroot=glibconly_with_tag=glibc-2_6-branchr1=1.63r2=1.63.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/stdio-common/tfformat.c.diff?cvsroot=glibconly_with_tag=glibc-2_6-branchr1=1.10r2=1.10.2.1


Reply at: https://bugs.launchpad.net/glibc/+bug/128355/comments/8


On 2007-07-31T12:44:40+00:00 Cvs-commit wrote:

Subject: Bug 4858

CVSROOT:/cvs/glibc
Module name:libc
Branch: glibc-2_5-branch
Changes by: ja...@sourceware.org2007-07-31 12:44:28

Modified files:
.  : ChangeLog 
stdio-common   : printf_fp.c tfformat.c 

Log message:
2007-07-31  Jakub Jelinek  ja...@redhat.com

* stdio-common/tfformat.c (sprint_doubles): Add 12 new tests.

2007-07-28  Ulrich Drepper  drep...@redhat.com

[BZ #4858]
* stdio-common/printf_fp.c (___printf_fp): Fix special case of
#.0g and value rounded to 1.0.
* stdio-common/tfformat.c (sprint_doubles): Add two new tests.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/ChangeLog.diff?cvsroot=glibconly_with_tag=glibc-2_5-branchr1=1.10362.2.96r2=1.10362.2.97
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/stdio-common/printf_fp.c.diff?cvsroot=glibconly_with_tag=glibc-2_5-branchr1=1.58.2.3r2=1.58.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/stdio-common/tfformat.c.diff?cvsroot=glibconly_with_tag=glibc-2_5-branchr1=1.7.8.2r2=1.7.8.3


Reply at: https://bugs.launchpad.net/glibc/+bug/128355/comments/9


** Changed in: glibc
   

[Bug 128355] Re: libc6 printf alternate format %#.g prints wrong number of digits

2007-07-29 Thread Bug Watch Updater
** Changed in: glibc (upstream)
   Status: Confirmed = Fix Released

-- 
libc6 printf alternate format %#.g prints wrong number of digits
https://bugs.launchpad.net/bugs/128355
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 128355] Re: libc6 printf alternate format %#.g prints wrong number of digits

2007-07-29 Thread Matthias Klose
glibc (2.6-5ubuntu1) gutsy; urgency=low

  * Merge with Debian.
-  cvs-printf_fp.c.diff: new patch to  print the wrong number of
   digits with %#g. LP: #128355.

 -- Matthias Klose [EMAIL PROTECTED]   Sun, 29 Jul 2007 20:39:57 +0200

** Changed in: glibc (Ubuntu)
   Status: New = Fix Released

-- 
libc6 printf alternate format %#.g prints wrong number of digits
https://bugs.launchpad.net/bugs/128355
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 128355] Re: libc6 printf alternate format %#.g prints wrong number of digits

2007-07-28 Thread Bug Watch Updater
** Changed in: glibc (upstream)
   Status: Unknown = Confirmed

-- 
libc6 printf alternate format %#.g prints wrong number of digits
https://bugs.launchpad.net/bugs/128355
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 128355] Re: libc6 printf alternate format %#.g prints wrong number of digits

2007-07-27 Thread Wirawan Purwanto
** Bug watch added: Sourceware.org Bugzilla #4858
   http://sourceware.org/bugzilla/show_bug.cgi?id=4858

** Also affects: glibc (upstream) via
   http://sourceware.org/bugzilla/show_bug.cgi?id=4858
   Importance: Unknown
   Status: Unknown

-- 
libc6 printf alternate format %#.g prints wrong number of digits
https://bugs.launchpad.net/bugs/128355
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 128355] Re: libc6 printf alternate format %#.g prints wrong number of digits

2007-07-27 Thread Wirawan Purwanto
I submitted the corresponding bug report in sources.redhat.com, as bug
#4858 . I found out that even the stock glibc 2.6 has it.

Wirawan

-- 
libc6 printf alternate format %#.g prints wrong number of digits
https://bugs.launchpad.net/bugs/128355
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 128355] Re: libc6 printf alternate format %#.g prints wrong number of digits

2007-07-25 Thread Wirawan Purwanto
This, as it turns out, did not happen if we use libc.a  in
libc6-dev_2.5-0ubuntu14_i386.deb . So what happens? Perhaps the patch
was missing or wrong in the newer libc?

Wirawan

-- 
libc6 printf alternate format %#.g prints wrong number of digits
https://bugs.launchpad.net/bugs/128355
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs