P
Peter Nilsson
Army1987 said:Peter said:Army1987 wrote:
Keith Thompson wrote:
Just recently we've seen three examples of lcc-win
features that violate the standard: your "%b" format
for printf
Why?
7.19.6.1:
"9 If a conversion specification is invalid, the
behavior is undefined."
Lowercase conversion specifiers are reserved for future use
[cf 7.26.9.] If lcc-win used %B instead, it would be fine.
So? I think it's not broken *yet*, since as of C99 + TC3
(i.e. n1256), a program with printf("%b"); is allowed to do
anything.
The issue is whether Jacob's implementation (which claims
conformance) has the right to define a behaviour for %b.
It does not.
For example, glibc's printf() prints strerror(errno) with
the %m specifier.
That too is broken.
Yes, using capitals would lower the chances for it to be
broken *in future*,
You miss the point of some of the standard's reservations.
They allow the committee to make choices that aren't already
tainted with widespread differences, viz snprintf.
But it's not just conversion specifiers with lcc-win, it's
length modifiers as well. Though Jacob at least asked last
time before he ignored advice...
"So many people has stolen the extra format characters for
various purposes that we actually had a hard time finding
one for use with fixed-point types in the embeded systems
TR. Since whoever uses these extensions surely cannot
expect other printf implementations to uderstand them, no
portability purpose is achieved by adding them to printf."
- Doug Gwyn, csc
but as it stands, it is not one of the
reasons why lcc-win32 is broken.
It is certainly not one of the main reasons. Nevertheless,
using a facet that implementors are specifically asked _not_
to use potentially undermines future standards. This is
ironic from a person who claims to want to improve the C
language.