Mail Archives: djgpp/2003/07/29/08:40:53
Thanks for your explanations and sorry for
using probably too "egocentric" wording.
"Eli Zaretskii" <eliz AT elta DOT co DOT il> wrote in message
news:uoezd3kqs DOT fsf AT elta DOT co DOT il...
> > From: "News Reader" <nospam AT aol DOT com>
> > Newsgroups: comp.os.msdos.djgpp
> > Date: Tue, 29 Jul 2003 02:00:54 +0200
> >
> > Being human and therefore being prone to making mistakes
> > from time to time, I will not allow any of my programs to run
> > if the compiler output produces a single warning as a matter
> > of principle.
>
> That's fine, but it's not really an issue here, although it sounds
> like you were mistaken to think it was (or else failed to make it
> clear what did ``won't work'' mean).
>
> > Compilation of your code produces the following output:
> >
> > x.c: In function `main':
> > x.c:7: warning: unknown conversion type character `U' in format
> > x.c:7: warning: too many arguments for format
>
> Right, I also saw those messages under -Wall, and I expect to see
> them, as GCC doesn't know about %U.
>
> > Therefore %U won't work (for me). The same applies to
> > %D and %O although even here program outputs appear
> > to be correct.
>
> You see, this is why it's important to explain what does it mean
> ``won't work'': your definition of that might be perfectly correct
> and clear for you, but not for others, nor, as it happens to be, is
> it correct objectively. The program does work and produces the
> correct results, while using -Wall is optional and is not required to
> compile a valid program. (In fact, some prominent programmers, such
> as Richard Stallman, are opposed to using -Wall in principle, because
> it sometimes flags perfectly valid code. I do use -Wall as a matter
> of routine, btw.)
>
> > I am well aware of the differences between signed and unsigned,
> > thanks, I was just cutting into this thread to get the %U mystery
> > solved.
>
> I hope it is solved now. If not, please ask more questions.
>
> > (Still wondering why %U was ever documented if it is non-standard
> > and produces warnings?)
>
> Because DJGPP wants to be compatible to old DOS compilers, like
> Borland's one and the old MSC.
>
> Note that your original message said ``why is %U documented if it
> doesn't work'', which is quite a different story. If your wording was
> as above to begin with, it would have saved me quite some time that I
> wasted to (1) look at the library sources in search of a possible bug,
> (2) write a test program to see if %U really worked like the sources
> seem to claim, and (3) post a message that explained in so many words
> what I thought might be the source of your confusion. Instead of all
> that, I could simply tell you about the compatibility issue, and
> that's all.
>
- Raw text -