Mail Archives: djgpp/1997/10/21/01:27:39
Hi all
I compile with the options: -W -Wall -Werror and -Wformat
The one of interset here is -Wformat. The other day I typed this:
sprintf( str, "%D", i )
where str is a char* and i is a long int.
DJGPP says that "%D" is an invalid format specifier: yet the libc info docs
say it is a long integer... hmmm.. strange. So I just used %li instead,
which was fine. I was just curious why the other one supposedly is wron (I
didn't try to actually run it with that, so I don't know if it actually does
work once I turn off the Wformat option to compile correctly. Suppose I
shouldv'e done that.
Anyway, does anyone have a historical or other reason why there are so many
ambiguities in the printf options anyway? Like %d and %i. Or am I just
ignorant or some special feature of each?
Thought I'd let you know. If it is a GCC bug and not a DJGPP bug I will
report it to the relevant "authorities".
Thanks
Brett
--
"Who here believes in telekenesis? Raise MY hand!"
--
Brett Porter
bporter AT rabble DOT uow DOT edu DOT au
http://www.geocities.com/CollegePark/Union/3596
Humour, Programming, and more.
- Raw text -