Date: Tue, 21 Oct 1997 13:24:55 +0200 (IST) From: Eli Zaretskii To: Brett Porter cc: DJGPP Subject: Re: gcc warning bug or just non-standard type? In-Reply-To: <199710210524.PAA06866@rabble.uow.edu.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Tue, 21 Oct 1997, Brett Porter wrote: > DJGPP says that "%D" is an invalid format specifier: yet the libc info docs > say it is a long integer... hmmm.. strange. Some format letters are standard (ANSI/ISO) C, others are extensions. GCC doesn't know anything about the library, so it only knows about ANSI standard formats. "%D" indeed is not ANSI. > 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. That's up to you. But I would suggest to not use non-standard extensions where standard features exist with the same functionality. My experience indicates that not only is this good for portability, but also standard features usually have much less bugs (because they are well-defined, and because test suites exist to test them).