libc implementations supporting C99 formats
Robert Lipe
robertlipe@usa.net
Tue Oct 17 18:51:00 GMT 2000
> > The new SCO UDK for UnixWare and OpenServer purports to support all
> > library but "return value for snprintf(3S) when the destination
> > array is not long enough" and all language features other than
> > complex arithmetic and VLA's.
>
> An obvious sanity check that the printf/scanf may be working C99
> implementations would be to printf an infinity with all eight floating
> point formats (%a %e %f %g %A %E %F %G) and check that it comes out as
> "inf" or "infinity" with the lowercase ones and "INF" or "INFINITY"
> with the uppercase ones (this being the only difference between %f and
I thought you were looking for a "tie breaker" or something. I have no
reason to doubt its degree of conformance. :-) This program yields no
suprises once the output is cut and pasted back to its input.
#include <stdio.h>
#include <math.h>
float x = INFINITY;
main()
{
float a, b, c, d, e, f, g, h;
printf("%a %e %f %g %A %E %F %G\n", x, x, x, x, x, x, x, x);
scanf("%a %e %f %g %A %E %F %G", &a, &b, &c, &d, &e, &f, &g, &h);
printf("%a %e %f %g %A %E %F %G\n", a, b, c, d, e, f, g, h);
}
> appropriate to include a note that you need library support to use the new
> formats as well as a compiler which understands them with -Wall, and to
Sounds like a good idea to note this.
> indicate something about the availability of such support; subject to any
> limitations on not appearing to promote non-free software it seems it
> would be useful to give some indication of where, apart from glibc 2.2 for
> GNU/Linux and HURD, such formats can be used.
I don't know the precise version number on it, but the SCO UDK for
UnixWare 7 and OpenServer 5 supports the bulk of C99 and seems to have
the specific library support you're asking about. It was released
fairly recently.
Thanx for asking.
RJL
More information about the Gcc
mailing list