Hi,

I build postfix 3.11.2 with musl lib, and it compile failed with failure:

vbuf_print.c:215:46: error: macro 'VBUF_SNPRINTF' passed 5 arguments, but takes just 4
  215 |                     VSTRING_ADDNUM(fmt, width);
      |                                              ^
vbuf_print.c:132:9: note: macro 'VBUF_SNPRINTF' defined here
  132 | #define VBUF_SNPRINTF(bp, sz, fmt, arg) do { \


Root cause:

[snip of src/util/sys_defs.h]

#if HAVE_GLIBC_API_VERSION_SUPPORT(2, 1)
#define SOCKADDR_SIZE   socklen_t
#define SOCKOPT_SIZE    socklen_t
#else
#define NO_SNPRINTF
#endif

[snip of src/util/sys_defs.h]

For musl lib, #else branch is selected, so NO_SNPRINTF is defined,  and in vbuf_print.c,  if NO_SNPRINTF is defined,

VBUF_SNPRINTF takes 4 arguments,  but where calling VBUF_SNPRINTF all pass 5 arguments, seems like where calling VBUF_SNPRINTF

should also checking NO_SNPRINTF to pass 4 or 5 arguments.


But actually, musl lib support snprintf.  so maybe it should like this?

-#if HAVE_GLIBC_API_VERSION_SUPPORT(2, 1)
+#if HAVE_GLIBC_API_VERSION_SUPPORT(2, 1) || !defined(__GLIBC__)

How about other places also use HAVE_GLIBC_API_VERSION_SUPPORT, is it possible have similar issue like this?


Regards

Changqing

_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to