diff --git a/ChangeLog b/ChangeLog index e7acc42..e7363dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -362,6 +362,45 @@ Version 1.8.0 Version 1.6.20 ******************************************************************************* +2015-02-04 Shaun Marko + + Bug tracker #124 Build fails with --enable-debug + + Build environment + Fedora 21 + X86-64 + * gcc 4.9.2 + + How to repeat + $ ./configure --enable debug + $ make + libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I../upnp/inc -I./inc -I../threadutil/inc + -I../ixml/inc -I./src/inc -pthread -g -O2 -Wall -MT src/api/libupnp_la-UpnpString.lo + -MD -MP -MF src/api/.deps/libupnp_la-UpnpString.Tpo -c src/api/UpnpString.c + -fPIC -DPIC -o src/api .libs/libupnp_la-UpnpString.o src/api/UpnpString.c:47:16: + error: expected identifier or '(' before 'extension' + extern char *strndup(const char *string, size_t __n); + ^ + Makefile:1016: recipe for target 'src/api/libupnp_la-UpnpString.lo' failed + + Reason for failure + Build enables -O2 optimization flags which causes the inclusion of a + macro implementation of strndup from include/bits/string2.h. + + Workarounds + Disable optimization when configuring or making: + $ configure CFLAGS='-g -pthread -O0' --enable-debug + $ make + or + $ configure --enable-debug + $ make CFLAGS='-g -pthread -O0' Define NO_STRING_INLINES + $ export CFLAGS="-DNO_STRING_INLINES -O2" + $ ./configure --enagble-debug + $ make + + Fix + * Don't declare strndup in src/api/UpnpString.c if it exists + 2015-02-01 Jean-Francois Dockes Out-of-tree builds seem to be currently broken, because ixml and diff --git a/THANKS b/THANKS index 1081c06..fbb2ebf 100644 --- a/THANKS +++ b/THANKS @@ -65,6 +65,7 @@ exempt of errors. - Robert Gingher (robsbox) - Ronan Menard - Sebastian Brandt +- Shaun Marko (semarko) - Siva Chandran - Stefan Sommerfeld (zerocom) - Stéphane Corthésy diff --git a/upnp/src/api/UpnpString.c b/upnp/src/api/UpnpString.c index 41c9898..68f1e33 100644 --- a/upnp/src/api/UpnpString.c +++ b/upnp/src/api/UpnpString.c @@ -43,9 +43,7 @@ #endif /* WIN32 */ /* strndup() is a GNU extension. */ -#if HAVE_STRNDUP && !defined(WIN32) - extern char *strndup(__const char *__string, size_t __n); -#else /* HAVE_STRNDUP && !defined(WIN32) */ +#if !HAVE_STRNDUP || defined(WIN32) static char *strndup(const char *__string, size_t __n) { size_t strsize = strnlen(__string, __n);