Blob Blame History Raw
Patch by Robert Scheck <robert@fedoraproject.org> for zarafa >= 7.0.8, which works
around the insane written C/C++ code. I am not a C/C++ developer, but you only can
use four macros for handling va_list at all: va_start, va_arg, va_copy and va_end.

As a developer you should not assume that va_list is always internally typed as an
integer because it is case on i?86 and x86_64 for example. Architectures like ARM
handle va_list not as an integer and thus fail during compiling like this:

Trace.cpp:129:16: error: invalid operands of types 'va_list {aka __va_list}' and
  'int' to binary 'operator!='
Trace.cpp:142:16: error: invalid operands of types 'va_list {aka __va_list}' and
  'int' to binary 'operator!='

As it is unfortunately not safe to assume that format does not contain attributes
while va is empty this workaround is only applied on the affected ARM architecture
for now. The only real solution is a clean rewrite of the code that should happen
upstream.

--- zarafa-7.0.8/common/Trace.cpp		2012-06-18 18:55:29.000000000 +0200
+++ zarafa-7.0.8/common/Trace.cpp.va_list	2012-06-20 01:20:06.000000000 +0200
@@ -126,7 +126,11 @@
 
 	len = pos + 3;
 
+#if defined __ARM_EABI__
+	if (format) {
+#else
 	if (format && va) {
+#endif
 		va_copy(va_lentest, va);
 		len += _vsnprintf(NULL, 0, format, va_lentest);
 		va_end(va_lentest);
@@ -139,7 +143,11 @@
 
 	memcpy(buffer, debug, pos);
 
+#if defined __ARM_EABI__
+	if (format)
+#else
 	if (format && va)
+#endif
 		pos = _vsnprintf(buffer+pos, len-pos, format, va);
 
 	if(pos == -1) {