From: johann Date: Fri, 2 May 2008 20:24:28 +0000 (+0000) Subject: Branch b_release_1_6_5 X-Git-Tag: v1_7_0_50~28 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=e5f235d8d5a36c11ff5004e6e4c5ffa69b9eaaaa;p=fs%2Flustre-release.git Branch b_release_1_6_5 b=15517 i=johann i=umka Fix compile warnings on i686. --- diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index c016f84..4a47927 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -1058,11 +1058,11 @@ AC_DEFINE(HAVE_SHOW_TASK, 1, [show_task is exported]) # check userland __u64 type AC_DEFUN([LN_U64_LONG_LONG], -[AC_MSG_CHECKING([check u64 is long long type]) +[AC_MSG_CHECKING([u64 is long long type]) tmp_flags="$CFLAGS" CFLAGS="$CFLAGS -Werror" AC_COMPILE_IFELSE([ - #include + #include int main(void) { unsigned long long *data1; __u64 *data2; @@ -1075,10 +1075,59 @@ AC_COMPILE_IFELSE([ AC_DEFINE(HAVE_U64_LONG_LONG, 1, [__u64 is long long type]) ],[ + AC_MSG_RESULT([no]) +]) +CFLAGS="$tmp_flags" +]) + +# check userland size_t type +AC_DEFUN([LN_SIZE_T_LONG], +[AC_MSG_CHECKING([size_t is unsigned long type]) +tmp_flags="$CFLAGS" +CFLAGS="$CFLAGS -Werror" +AC_COMPILE_IFELSE([ + #include + int main(void) { + unsigned long *data1; + size_t *data2; + + data1 = data2; + return 0; + } +],[ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_SIZE_T_LONG, 1, + [size_t is long type]) +],[ + AC_MSG_RESULT([no]) ]) CFLAGS="$tmp_flags" ]) +AC_DEFUN([LN_SSIZE_T_LONG], +[AC_MSG_CHECKING([ssize_t is signed long type]) +tmp_flags="$CFLAGS" +CFLAGS="$CFLAGS -Werror" +AC_COMPILE_IFELSE([ + #include + int main(void) { + long *data1; + ssize_t *data2; + + data1 = data2; + return 0; + } +],[ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_SSIZE_T_LONG, 1, + [ssize_t is long type]) +],[ + AC_MSG_RESULT([no]) +]) +CFLAGS="$tmp_flags" +]) + + # LN_TASKLIST_LOCK # 2.6.18 remove tasklist_lock export AC_DEFUN([LN_TASKLIST_LOCK], @@ -1229,6 +1278,8 @@ LN_STRUCT_PAGE_LIST LN_STRUCT_SIGHAND LN_FUNC_SHOW_TASK LN_U64_LONG_LONG +LN_SSIZE_T_LONG +LN_SIZE_T_LONG # 2.6.18 LN_TASKLIST_LOCK # 2.6.19 diff --git a/lnet/include/libcfs/linux/kp30.h b/lnet/include/libcfs/linux/kp30.h index 7de45d6..19355ed 100644 --- a/lnet/include/libcfs/linux/kp30.h +++ b/lnet/include/libcfs/linux/kp30.h @@ -346,23 +346,30 @@ extern int lwt_snapshot (cycles_t *now, int *ncpu, int *total_size, # define LPD64 "%Ld" # define LPX64 "%#Lx" # define LPF64 "L" -# define LPSZ "%lu" -# define LPSSZ "%ld" #elif (_LWORDSIZE == 32) # define LPU64 "%Lu" # define LPD64 "%Ld" # define LPX64 "%#Lx" # define LPF64 "L" -# define LPSZ "%u" -# define LPSSZ "%d" #elif (_LWORDSIZE == 64) # define LPU64 "%lu" # define LPD64 "%ld" # define LPX64 "%#lx" # define LPF64 "l" +#endif + +#ifdef HAVE_SIZE_T_LONG # define LPSZ "%lu" +#else +# define LPSZ "%u" +#endif + +#ifdef HAVE_SSIZE_T_LONG # define LPSSZ "%ld" +#else +# define LPSSZ "%d" #endif + #ifndef LPU64 # error "No word size defined" #endif diff --git a/lustre/tests/it_test.c b/lustre/tests/it_test.c index da9256d..44c7f6f 100644 --- a/lustre/tests/it_test.c +++ b/lustre/tests/it_test.c @@ -7,6 +7,7 @@ #include #include +#include #include <../ldlm/interval_tree.c> #define dprintf(fmt, args...) //printf(fmt, ##args) @@ -17,7 +18,7 @@ } while(0) #define __F(ext) (ext)->start, (ext)->end -#define __S "[%llx:%llx]" +#define __S "["LPX64":"LPX64"]" #define ALIGN_SIZE 4096 #define ALIGN_MASK (~(ALIGN_SIZE - 1))