This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
snprintf warnings
- From: "Eli Zaretskii" <eliz at gnu dot org>
- To: gdb at sources dot redhat dot com
- Date: Sat, 13 Nov 2004 16:52:24 +0200
- Subject: snprintf warnings
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
When I build GDB with DJGPP, GCC whines like so:
remote.c: In function `remote_xfer_partial':
remote.c:4920: warning: implicit declaration of function `snprintf'
(I see this warning for other source files as well.)
This happens because DJGPP doesn't have `snprintf' in its library, so
the libiberty version is used. But there's no prototype for the
libiberty `snprintf' anywhere, thus the warning. The code seems to be
relying on getting the prototype from stdio.h, but if the library
doesn't have the function, we cannot expect to have the prototype on a
standard header.
What would be the canonical way to fix that?