tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

libgpg-error: va_list issue



Hello,
on netbsd-HEAD/earmv7hf, libgpg-error fails to build with:
logging.c: In function '_gpgrt_log_printhex':
logging.c:1153:49: error: incompatible type for argument 4 of '_gpgrt_logv_print
hex'
     _gpgrt_logv_printhex (buffer, length, NULL, NULL);
                                                 ^~~~
logging.c:1097:1: note: expected 'va_list {aka __va_list}' but argument is of ty
pe 'void *'
 _gpgrt_logv_printhex (const void *buffer, size_t length,


I came up with the attached patch but as I'm not familiar with variadic
functions I'm not sure it's correct for the fmt == NULL case
(i.e. what va_start(arg_ptr, NULL) will do).
Can someone confirm that this patch is correct ? If not, how should we fix it ?

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--
$NetBSD: $

--- src/logging.c.orig	2018-04-10 09:18:01.603169447 +0200
+++ src/logging.c	2018-04-10 09:32:30.546733886 +0200
@@ -1143,14 +1143,9 @@
 {
   va_list arg_ptr;
 
-  if (fmt)
-    {
-      va_start (arg_ptr, fmt);
-      _gpgrt_logv_printhex (buffer, length, fmt, arg_ptr);
-      va_end (arg_ptr);
-    }
-  else
-    _gpgrt_logv_printhex (buffer, length, NULL, NULL);
+  va_start (arg_ptr, fmt);
+  _gpgrt_logv_printhex (buffer, length, fmt, arg_ptr);
+  va_end (arg_ptr);
 }
 
 


Home | Main Index | Thread Index | Old Index