don't produce a false negative for %z with CFLAGS=-Werror

This commit is contained in:
Mark Andrews
2018-05-18 12:17:31 +10:00
parent 906565a274
commit 800012de23
+3 -1
View File
@@ -3690,12 +3690,14 @@ AC_CHECK_FUNC(vsnprintf, [],
AC_MSG_CHECKING(printf for %z support)
AC_TRY_RUN([
#include <stdio.h>
int
main() {
size_t j = 0;
char buf[100];
buf[0] = 0;
sprintf(buf, "%zu", j);
exit(strcmp(buf, "0") != 0);
return ((buf[0] == '0' && buf[1] == '\0') ? 0 : 1);
}
],
[AC_MSG_RESULT(yes)],