]> git.kaiwu.me - nginx.git/commitdiff
Fixed compilation warnings in configuration C tests.
authorRuslan Ermilov <ru@nginx.com>
Thu, 15 Mar 2012 20:39:38 +0000 (20:39 +0000)
committerRuslan Ermilov <ru@nginx.com>
Thu, 15 Mar 2012 20:39:38 +0000 (20:39 +0000)
Based on a patch by Piotr Sikora.

auto/os/linux
auto/types/sizeof
auto/types/typedef
auto/types/uintptr_t
auto/unix

index 0b2173cae9c2351d78acd5887f2f40c4dd92b110..dba11a4bcea229fa3943dd39dde8a2f301f7b443 100644 (file)
@@ -52,7 +52,7 @@ ngx_feature_run=yes
 ngx_feature_incs="#include <sys/epoll.h>"
 ngx_feature_path=
 ngx_feature_libs=
-ngx_feature_test="int efd = 0, fd = 1, n;
+ngx_feature_test="int efd = 0;
                   struct epoll_event ee;
                   ee.events = EPOLLIN|EPOLLOUT|EPOLLET;
                   ee.data.ptr = NULL;
@@ -142,7 +142,7 @@ ngx_feature_incs="#include <crypt.h>"
 ngx_feature_path=
 ngx_feature_libs=-lcrypt
 ngx_feature_test="struct crypt_data  cd;
-                  crypt_r(NULL, NULL, &cd);"
+                  crypt_r(\"key\", \"salt\", &cd);"
 . auto/feature
 
 
index e84a0905ef9ac9f5d6718f8ea8f52f3848e9ed53..31411dde3853e85a9d2ecf9fa3b3849190b7e5c0 100644 (file)
@@ -20,12 +20,13 @@ cat << END > $NGX_AUTOTEST.c
 #include <sys/time.h>
 $NGX_INCLUDE_UNISTD_H
 #include <signal.h>
+#include <stdio.h>
 #include <sys/resource.h>
 $NGX_INCLUDE_INTTYPES_H
 $NGX_INCLUDE_AUTO_CONFIG_H
 
 int main() {
-    printf("%d", sizeof($ngx_type));
+    printf("%zu", sizeof($ngx_type));
     return 0;
 }
 
index f121e8fc2ea95bc585964893cfac4809fbe0f685..697190097cc3f5ef2e2ea31ca32e3d9bafcc26ea 100644 (file)
@@ -28,7 +28,8 @@ do
 $NGX_INCLUDE_INTTYPES_H
 
 int main() {
-    $ngx_try i = 0;
+    $ngx_try i;
+    i = 0;
     return 0;
 }
 
index 07f7e7d7dbadfa8f3b01d1377ce0bfc80517fc9e..2a00b493cdc8402ad61a616a89140640b3296a8b 100644 (file)
@@ -4,8 +4,8 @@
 
 
 echo $ngx_n "checking for uintptr_t ...$ngx_c"
-echo >> $NGX_ERR
-echo "checking for uintptr_t" >> $NGX_ERR
+echo >> $NGX_AUTOCONF_ERR
+echo "checking for uintptr_t" >> $NGX_AUTOCONF_ERR
 
 found=no
 
@@ -15,13 +15,17 @@ cat << END > $NGX_AUTOTEST.c
 $NGX_INTTYPES_H
 
 int main() {
-    uintptr_t i = 0;
+    uintptr_t i;
+    i = 0;
     return 0;
 }
 
 END
 
-eval "$CC -o $NGX_AUTOTEST $NGX_AUTOTEST.c >> $NGX_ERR 2>&1"
+ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
+          -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT"
+
+eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
 
 if [ -x $NGX_AUTOTEST ]; then
     echo " uintptr_t found"
index d786bb4339fea2c84baed461bce588852d6924e6..88b2cbee737345063876e6b2dbf74548b9a8ce7d 100755 (executable)
--- a/auto/unix
+++ b/auto/unix
@@ -237,7 +237,7 @@ ngx_feature_incs="$NGX_INCLUDE_SYS_PARAM_H
 ngx_feature_path=
 ngx_feature_libs=
 ngx_feature_test="struct statfs  fs;
-                  statfs(NULL, &fs);"
+                  statfs(\".\", &fs);"
 . auto/feature
 
 
@@ -249,7 +249,7 @@ ngx_feature_incs="#include <sys/types.h>
 ngx_feature_path=
 ngx_feature_libs=
 ngx_feature_test="struct statvfs  fs;
-                  statvfs(NULL, &fs);"
+                  statvfs(\".\", &fs);"
 . auto/feature
 
 
@@ -481,7 +481,7 @@ fi
 ngx_feature="setproctitle()"
 ngx_feature_name="NGX_HAVE_SETPROCTITLE"
 ngx_feature_run=no
-ngx_feature_incs=
+ngx_feature_incs="#include <stdlib.h>"
 ngx_feature_path=
 ngx_feature_libs=$NGX_SETPROCTITLE_LIB
 ngx_feature_test="setproctitle(\"test\");"
@@ -585,7 +585,8 @@ ngx_feature_test="void *p; int n; n = posix_memalign(&p, 4096, 4096)"
 ngx_feature="memalign()"
 ngx_feature_name="NGX_HAVE_MEMALIGN"
 ngx_feature_run=no
-ngx_feature_incs="#include <stdlib.h>"
+ngx_feature_incs="#include <stdlib.h>
+                  #include <malloc.h>"
 ngx_feature_path=
 ngx_feature_libs=
 ngx_feature_test="void *p; p = memalign(4096, 4096)"