This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

GCC library bug found


I think that I have found a minor bug in the GCC run-time library.

When I run the following program:

/* test.c */

#include <stdio.h>
#include <stdlib.h>

int main(void)
{     double val = 0.0;
      printf("val = %17.9e  \n", val);
      return 0;
}

/* eof */

it prints the following line:

val =   0. ??      e+00

where ?? are some unprintable characters. In hex this line is:

76 61 6C 20 3D 20 20 20 30 2E 00 8D B6 00 00 00
00 00 00 65 2B 30 30 20 20 0A

I should say that this bug sometimes doesn't appear (in other programs,
usually after several calls to the printf routine with other format
strings).

It is obvious that this bug sits in the print formatting routine due to
that zeros are printed in such inconvenient form.

I use GCC 2.95.2 under Cygwin 1.1.2.

Thank you,

Andrew Makhorin,
maintainer of GNU marst





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]