From: Willem Toorop Date: Thu, 26 May 2011 11:46:28 +0000 (+0000) Subject: Suppress as many warnings as possible when building pyldns and explain the others. X-Git-Tag: release-1.6.10~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4dcc6c676225598eaad95471f3939878efc489f4;p=thirdparty%2Fldns.git Suppress as many warnings as possible when building pyldns and explain the others. --- diff --git a/Makefile.in b/Makefile.in index b1c59640..a25f24b9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -44,6 +44,7 @@ LIBS = @LIBS@ LIBOBJS = @LIBOBJS@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ +PYTHON_X_CFLAGS = @PYTHON_X_CFLAGS@ LIBSSL_CPPFLAGS = @LIBSSL_CPPFLAGS@ LIBSSL_LDFLAGS = @LIBSSL_LDFLAGS@ LIBSSL_LIBS = @LIBSSL_LIBS@ @@ -170,7 +171,7 @@ $(pywrapdir)/ldns_wrapper.c: $(pywrapdir)/ldns.i $(wildcard $(pywrapdir)/*.i) $( $(swig) -python -o $@ $(CPPFLAGS) $(PYTHON_CPPFLAGS) $< ldns_wrapper.lo: $(pywrapdir)/ldns_wrapper.c $(LIBDNS_HEADERS) ldns/common.h ldns/util.h ldns/config.h - $(COMP_LIB) -I./include/ldns $(PYTHON_CPPFLAGS) -c $< -o $@ + $(COMP_LIB) -I./include/ldns $(PYTHON_CPPFLAGS) $(PYTHON_X_CFLAGS) -c $< -o $@ _ldns.la: ldns_wrapper.lo libldns.la $(LIBTOOL) --tag=CC --mode=link $(CC) $(strip $(CFLAGS) $(PYTHON_CFLAGS) $(LDFLAGS) $(PYTHON_LDFLAGS) -module -version-number $(version_info) -no-undefined -o $@ $< -rpath $(python_site) -L. -L.libs -lldns $(LIBS)) diff --git a/README b/README index 74e470a0..70eb3dc0 100644 --- a/README +++ b/README @@ -8,6 +8,8 @@ Contents: INFORMATION FOR SPECIFIC OPERATING SYSTEMS Mac OS X Solaris + KNOWN ISSUES + pyldns Your Support Project page: @@ -65,6 +67,7 @@ commands may be a little bit different on your machine. Most notable, you'll nee * Developers ldns is developed by the ldns team at NLnet Labs. This team currently consists of: + o Willem Toorop o Wouter Wijngaards o Matthijs Mekking @@ -74,6 +77,7 @@ Former main developers: * Credits We have received patches from the following people, thanks! + o Bedrich Kosata o Erik Rozendaal o Håkan Olsson o Jakob Schlyter @@ -82,7 +86,7 @@ We have received patches from the following people, thanks! o Ondřej Surý -IFORMATION FOR SPECIFIC OPERATING SYSTEMS +INFORMATION FOR SPECIFIC OPERATING SYSTEMS MAC OS X @@ -103,6 +107,17 @@ compile in 64-bit mode. Jakob Schlyter has kindly contributed a build script that sets the right build and link options. You can find it in contrib/build-solaris.sh +KNOWN ISSUES + +A complete list of currently known open issues can be found here: +http://www.nlnetlabs.nl/projects/ldns/bugs + +* pyldns +Compiling pyldns produces many ``unused parameter'' warnings. Those are +harmless and may safely be ignored. +Also when building with Swig which version is before 2.0.4, compiling +pyldns produces many ``missing initializer'' warnings. Those are harmless +too. Your Support NLnet Labs offers all of its software products as open source, most are diff --git a/configure.ac b/configure.ac index 45190d03..27a50732 100644 --- a/configure.ac +++ b/configure.ac @@ -84,6 +84,7 @@ AC_SEARCH_LIBS([socket], [socket]) AC_SEARCH_LIBS([inet_pton], [nsl]) # check for python +PYTHON_X_CFLAGS="" AC_ARG_WITH(pyldns, AC_HELP_STRING([--with-pyldns], [generate python library, or --without-pyldns to disable Python support.]), [],[ withval="no" ]) @@ -113,9 +114,15 @@ if test x_$withval != x_no; then AC_SUBST(swig, "$SWIG") fi else - AC_MSG_RESULT([*** don't have Python, skipping Swig, no pyldns ***]) + AC_MSG_RESULT([*** don't have Python, skipping Swig, no pyldns ***]) # ' + fi + + # xtra cflags for pyldns + if test x_$ldns_have_python != x_no; then + ACX_CHECK_COMPILER_FLAG(fno-strict-aliasing, [PYTHON_X_CFLAGS="-fno-strict-aliasing"]) fi fi +AC_SUBST(PYTHON_X_CFLAGS) # Use libtool ACX_LIBTOOL_C_ONLY diff --git a/contrib/python/ldns_buffer.i b/contrib/python/ldns_buffer.i index ce174087..1e743c00 100644 --- a/contrib/python/ldns_buffer.i +++ b/contrib/python/ldns_buffer.i @@ -51,6 +51,10 @@ %newobject ldns_dname_new_frm_data; %newobject ldns_dname_label; +# limit the number of arguments to 2 and +# deal with variable number of arguments the Python way +%varargs(2, char *arg = NULL) ldns_buffer_printf; + %rename(ldns_buffer) ldns_struct_buffer; #ifdef LDNS_DEBUG @@ -232,14 +236,15 @@ void _ldns_buffer_free (ldns_buffer* b) { #parameters: ldns_buffer *, #retvals: size_t - def printf(self,*str): + def printf(self, str, *args): """Prints to the buffer, increasing the capacity if required using buffer_reserve(). The buffer's position is set to the terminating '\0'. Returns the number of characters written (not including the terminating '\0') or -1 on failure. :param str: a string :returns: (int) """ - return _ldns.ldns_buffer_printf(self,*str) + data = str % args + return _ldns.ldns_buffer_printf(self,data) #parameters: ldns_buffer *,const char *,... #retvals: int