]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
don't produce a false negative for %z with CFLAGS=-Werror
authorMark Andrews <marka@isc.org>
Wed, 16 May 2018 03:50:13 +0000 (13:50 +1000)
committerMark Andrews <marka@isc.org>
Fri, 18 May 2018 02:51:20 +0000 (12:51 +1000)
(cherry picked from commit 800012de23ef63ff6d34dd7dac99cd2291955640)

configure.in

index 69d7e742b09af5cb1c6266b19cc896ff75dff559..0943ebb98de0f9f44a7ff0eb46b203a0f4a3ebd0 100644 (file)
@@ -2878,12 +2878,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)],