Henry Nelson wrote:
> When I compile programs that will link to both libintl and libslang,
> warnings occur like:
> /usr/local/include/slang.h:899: warning: `libintl_printf' is an unrecognized
> format function type
This warning is harmless; the only effect is that you get less gcc
warnings about buggy code.
You can get rid of this warning by changing /usr/local/include/slang.h
to use
_SLATTRIBUTE_((__format__(__printf__,a,b)))
instead of
_SLATTRIBUTE_((format(printf,a,b)))
> If I also try to link with libiconv, then a fatal error will occur.
More details, please?
> Would it be possible to not redefine printf in "libintl.h"?
Depends on the system / OS and programming language (C or C++?) that
you are using. On which system are you seeing the problems?
Bruno
If I also try to link with libiconv, then a fatal error will occur.
Would it be possible to not redefine printf in "libintl.h"?
Thank you for any help with this problem.
--
henry n.
PS. The lines in slang.h which lead to warnings/errors are:
899
SL_EXTERN void SLang_verror (int, char *, ...) SLATTRIBUTE_PRINTF(2,3);
995
SL_EXTERN void SLang_vmessage (char *, ...) SLATTRIBUTE_PRINTF(1,2);
1002
SL_EXTERN void SLang_exit_error (char *, ...) SLATTRIBUTE_((format (printf, 1, 2
), noreturn));
1686
SL_EXTERN void SLsmg_printf (char *, ...) SLATTRIBUTE_PRINTF(1,2);
Let me gather more information, and get back to you on this.
> > Would it be possible to not redefine printf in "libintl.h"?
>
> Depends on the system / OS and programming language (C or C++?) that
> you are using. On which system are you seeing the problems?
uname -sr => NetBSD 3.0.0_STABLE
gcc --version => gcc (GCC) 3.3.3 (NetBSD nb3 20040520)
The applications where this conflict applies (for me personally) are mutt
and lynx.
--
henry n.
Find attached a workaround. Thanks for the report.
Bruno
2006-06-19 Bruno Haible <br...@clisp.org>
* libgnuintl.h.in (libintl_printf): Define to __printf__ on NetBSD.
Reported by Henry Nelson <ne...@yuba.ne.jp>.
diff -r -c3 --exclude='*.po*' --exclude='*.info*' --exclude='*_*.html' --exclude='*.*.html' --exclude='*.[13]' --exclude='*.1.in' --exclude=Makefile.in --exclude=aclocal.m4 --exclude=configure --exclude=version.texi --exclude=stamp-vti --exclude='po-*-gen*.[ch]' --exclude='*.o' --exclude='*.lo' --exclude='*.gmo' --exclude=ABOUT-NLS --exclude='javadoc[12]' --exclude=CVS gettext-cvs/gettext-runtime/intl/libgnuintl.h.in gettext-6/gettext-runtime/intl/libgnuintl.h.in
*** gettext-cvs/gettext-runtime/intl/libgnuintl.h.in Wed May 17 00:38:10 2006
--- gettext-6/gettext-runtime/intl/libgnuintl.h.in Tue Jun 20 02:11:11 2006
***************
*** 330,335 ****
--- 330,340 ----
extern int vfprintf (FILE *, const char *, va_list);
#undef printf
+ #ifdef __NetBSD__
+ /* Don't break __attribute__((format(printf,M,N))). This redefinition is only
+ possible because NetBSD's libc does not have a function __printf__. */
+ # define libintl_printf __printf__
+ #endif
#define printf libintl_printf
extern int printf (const char *, ...);
#undef vprintf