Whamcloud - gitweb
LU-251 Fix gcc configure warnings
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
index 838f37e..38d3fa0 100644 (file)
@@ -494,17 +494,16 @@ LB_LINUX_TRY_COMPILE([
 #
 # kernel 2.6.13+ ->follow_link returns a cookie
 #
-
 AC_DEFUN([LC_COOKIE_FOLLOW_LINK],
 [AC_MSG_CHECKING([if inode_operations->follow_link returns a cookie])
 LB_LINUX_TRY_COMPILE([
         #include <linux/fs.h>
         #include <linux/namei.h>
 ],[
-        struct dentry dentry;
+        struct dentry *dentry = NULL;
         struct nameidata nd;
 
-        dentry.d_inode->i_op->put_link(&dentry, &nd, NULL);
+        dentry->d_inode->i_op->put_link(dentry, &nd, NULL);
 ],[
         AC_DEFINE(HAVE_COOKIE_FOLLOW_LINK, 1, [inode_operations->follow_link returns a cookie])
         AC_MSG_RESULT([yes])
@@ -586,9 +585,9 @@ AC_DEFUN([LC_S_TIME_GRAN],
 LB_LINUX_TRY_COMPILE([
         #include <linux/fs.h>
 ],[
-       struct super_block sb;
+        struct super_block *sb = NULL;
 
-        return sb.s_time_gran;
+        return sb->s_time_gran;
 ],[
        AC_MSG_RESULT([yes])
        AC_DEFINE(HAVE_S_TIME_GRAN, 1, [super block has s_time_gran member])
@@ -664,12 +663,9 @@ AC_DEFUN([LC_SECURITY_PLUG],
 [AC_MSG_CHECKING([If kernel has security plug support])
 LB_LINUX_TRY_COMPILE([
         #include <linux/fs.h>
+        #include <linux/stddef.h>
 ],[
-        struct dentry   *dentry;
-        struct vfsmount *mnt;
-        struct iattr    *iattr;
-
-        notify_change(dentry, mnt, iattr);
+        notify_change(NULL, NULL, NULL);
 ],[
         AC_MSG_RESULT(yes)
         AC_DEFINE(HAVE_SECURITY_PLUG, 1,
@@ -802,7 +798,7 @@ LB_LINUX_TRY_COMPILE([
         #include <linux/fs.h>
 ],[
         struct file_operations *fops = NULL;
-        fl_owner_t id;
+        fl_owner_t id = NULL;
         int i;
 
         i = fops->flush(NULL, id);
@@ -1058,7 +1054,7 @@ LB_LINUX_TRY_COMPILE([
         #include <linux/err.h>
         #include <linux/crypto.h>
 ],[
-        struct hash_desc foo;
+        struct hash_desc foo __attribute__ ((unused));
 ],[
         AC_MSG_RESULT([yes])
         AC_DEFINE(HAVE_STRUCT_HASH_DESC, 1, [kernel has struct hash_desc])
@@ -1076,7 +1072,7 @@ LB_LINUX_TRY_COMPILE([
         #include <linux/err.h>
         #include <linux/crypto.h>
 ],[
-        struct blkcipher_desc foo;
+        struct blkcipher_desc foo __attribute__ ((unused));
 ],[
         AC_MSG_RESULT([yes])
         AC_DEFINE(HAVE_STRUCT_BLKCIPHER_DESC, 1, [kernel has struct blkcipher_desc])
@@ -1093,7 +1089,8 @@ AC_DEFUN([LC_FS_RENAME_DOES_D_MOVE],
 LB_LINUX_TRY_COMPILE([
         #include <linux/fs.h>
 ],[
-        int v = FS_RENAME_DOES_D_MOVE;
+        int v __attribute__ ((unused));
+        v = FS_RENAME_DOES_D_MOVE;
 ],[
         AC_MSG_RESULT([yes])
         AC_DEFINE(HAVE_FS_RENAME_DOES_D_MOVE, 1, [kernel has FS_RENAME_DOES_D_MOVE flag])
@@ -1110,7 +1107,8 @@ AC_DEFUN([LC_UNREGISTER_BLKDEV_RETURN_INT],
 LB_LINUX_TRY_COMPILE([
         #include <linux/fs.h>
 ],[
-        int i = unregister_blkdev(0,NULL);
+        int i __attribute__ ((unused));
+        i = unregister_blkdev(0,NULL);
 ],[
         AC_MSG_RESULT([yes])
         AC_DEFINE(HAVE_UNREGISTER_BLKDEV_RETURN_INT, 1,
@@ -1337,7 +1335,9 @@ AC_DEFUN([LC_INODE_PERMISION_2ARGS],
 LB_LINUX_TRY_COMPILE([
         #include <linux/fs.h>
 ],[
-        struct inode *inode;
+        struct inode *inode __attribute__ ((unused));
+
+        inode = NULL;
         inode->i_op->permission(NULL, 0);
 ],[
         AC_DEFINE(HAVE_INODE_PERMISION_2ARGS, 1,
@@ -1411,9 +1411,10 @@ AC_DEFINE(HAVE_EXPORT_INODE_PERMISSION, 1,
 AC_DEFUN([LC_QUOTA_ON_5ARGS],
 [AC_MSG_CHECKING([quota_on needs 5 parameters])
 LB_LINUX_TRY_COMPILE([
+        #include <linux/fs.h>
         #include <linux/quota.h>
 ],[
-        struct quotactl_ops *qop;
+        struct quotactl_ops *qop = NULL;
         qop->quota_on(NULL, 0, 0, NULL, 0);
 ],[
         AC_DEFINE(HAVE_QUOTA_ON_5ARGS, 1,
@@ -1428,9 +1429,10 @@ LB_LINUX_TRY_COMPILE([
 AC_DEFUN([LC_QUOTA_OFF_3ARGS],
 [AC_MSG_CHECKING([quota_off needs 3 parameters])
 LB_LINUX_TRY_COMPILE([
+        #include <linux/fs.h>
         #include <linux/quota.h>
 ],[
-        struct quotactl_ops *qop;
+        struct quotactl_ops *qop = NULL;
         qop->quota_off(NULL, 0, 0);
 ],[
         AC_DEFINE(HAVE_QUOTA_OFF_3ARGS, 1,