[sr-dev] git:4.4:12b04801: xmlrpc: remove redeclaration of snprintf and vsnprintf
Victor Seva
linuxmaniac at torreviejawireless.org
Fri Jun 3 14:08:45 CEST 2016
Module: kamailio
Branch: 4.4
Commit: 12b0480169feab25ad68509c23f472155f10082b
URL: https://github.com/kamailio/kamailio/commit/12b0480169feab25ad68509c23f472155f10082b
Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2016-06-03T14:08:32+02:00
xmlrpc: remove redeclaration of snprintf and vsnprintf
compilation was failling with clang:
> CC (clang) [M xmlrpc.so] xmlrpc.o
> xmlrpc.c:152:5: error: expected parameter declarator
> int snprintf(char *str, size_t size, const char *format, ...);
> ^
> /usr/include/x86_64-linux-gnu/bits/stdio2.h:69:39: note: expanded from macro 'snprintf'
> __builtin___snprintf_chk (str, len, __USE_FORTIFY_LEVEL - 1, __bos (str), \
> ^
> /usr/include/features.h:329:31: note: expanded from macro '__USE_FORTIFY_LEVEL'
> # define __USE_FORTIFY_LEVEL 2
> ^
> xmlrpc.c:152:5: error: expected ')'
> /usr/include/x86_64-linux-gnu/bits/stdio2.h:69:39: note: expanded from macro 'snprintf'
> __builtin___snprintf_chk (str, len, __USE_FORTIFY_LEVEL - 1, __bos (str), \
> ^
> /usr/include/features.h:329:31: note: expanded from macro '__USE_FORTIFY_LEVEL'
> # define __USE_FORTIFY_LEVEL 2
> ^
> xmlrpc.c:152:5: note: to match this '('
> /usr/include/x86_64-linux-gnu/bits/stdio2.h:69:28: note: expanded from macro 'snprintf'
> __builtin___snprintf_chk (str, len, __USE_FORTIFY_LEVEL - 1, __bos (str), \
> ^
> xmlrpc.c:152:5: error: conflicting types for '__builtin___snprintf_chk'
> int snprintf(char *str, size_t size, const char *format, ...);
> ^
> /usr/include/x86_64-linux-gnu/bits/stdio2.h:69:3: note: expanded from macro 'snprintf'
> __builtin___snprintf_chk (str, len, __USE_FORTIFY_LEVEL - 1, __bos (str), \
> ^
> xmlrpc.c:152:5: note: '__builtin___snprintf_chk' is a builtin with type 'int (char *, unsigned long, int, unsigned long, const char *, ...)'
> /usr/include/x86_64-linux-gnu/bits/stdio2.h:69:3: note: expanded from macro 'snprintf'
> __builtin___snprintf_chk (str, len, __USE_FORTIFY_LEVEL - 1, __bos (str), \
> ^
> 3 errors generated.
(cherry picked from commit 358de10a94bef4df6b1811ac8e88ea4e7919542c)
---
Modified: modules/xmlrpc/xmlrpc.c
---
Diff: https://github.com/kamailio/kamailio/commit/12b0480169feab25ad68509c23f472155f10082b.diff
Patch: https://github.com/kamailio/kamailio/commit/12b0480169feab25ad68509c23f472155f10082b.patch
---
diff --git a/modules/xmlrpc/xmlrpc.c b/modules/xmlrpc/xmlrpc.c
index dabb526..16221e9 100644
--- a/modules/xmlrpc/xmlrpc.c
+++ b/modules/xmlrpc/xmlrpc.c
@@ -145,13 +145,6 @@
MODULE_VERSION
-#if defined (__OS_darwin) || defined (__OS_freebsd)
-/* redeclaration of functions from stdio.h throws errors */
-#else
-int snprintf(char *str, size_t size, const char *format, ...);
-int vsnprintf(char *str, size_t size, const char *format, va_list ap);
-#endif
-
static int process_xmlrpc(sip_msg_t* msg);
static int dispatch_rpc(sip_msg_t* msg, char* s1, char* s2);
static int xmlrpc_reply(sip_msg_t* msg, char* code, char* reason);
More information about the sr-dev
mailing list