[PATCH 6/7] fstat64: Fix Build warnings with common-generic ABI build

Vineet Gupta Vineet.Gupta1 at synopsys.com
Mon Mar 11 13:21:53 UTC 2013


  CC libc/sysdeps/linux/common/fstat64.os
In file included from libc/sysdeps/linux/common/fstat64.c:16:
libc/sysdeps/linux/common/xstatconv.h:28: warning: 'struct kernel_stat'
declared inside parameter list
libc/sysdeps/linux/common/xstatconv.h:28: warning: its scope is only
this definition or declaration, which is probably not what you want
libc/sysdeps/linux/common/fstat64.c: In function 'fstat64':
libc/sysdeps/linux/common/fstat64.c:33: warning: passing argument 2 of
'__syscall_fstat64' from incompatible pointer type
libc/sysdeps/linux/common/fstat64.c:18: note: expected 'struct stat *'
but argument is of type 'struct stat64 *'
-------------------------------------------------------------------

Signed-off-by: Vineet Gupta <vgupta at synopsys.com>
Cc: Markos Chandras <markos.chandras at imgtec.com>
---
 .../linux/common-generic/bits/kernel_stat.h        |    8 ++++++++
 libc/sysdeps/linux/common/xstatconv.h              |    2 ++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/libc/sysdeps/linux/common-generic/bits/kernel_stat.h b/libc/sysdeps/linux/common-generic/bits/kernel_stat.h
index a6f1d6c..843a1d1 100644
--- a/libc/sysdeps/linux/common-generic/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/common-generic/bits/kernel_stat.h
@@ -13,8 +13,16 @@
  * The stat structure defined in
  * libc/sysdeps/linux/common-generic/bits/stat.h
  * is the same as the kernel one for new architectures
+ *
+ * For the common-generic ABI we really don't need this file at all
+ * However that requires more #ifndef in relevant wrappers,
+ * further uglifying them
  */
+#if defined __UCLIBC_HAS_LFS__
+#define kernel_stat64	stat64
+#else
 #define kernel_stat64	stat
+#endif
 
 #endif	/*  _BITS_STAT_STRUCT_H */
 
diff --git a/libc/sysdeps/linux/common/xstatconv.h b/libc/sysdeps/linux/common/xstatconv.h
index a9e563f..cd4d7e9 100644
--- a/libc/sysdeps/linux/common/xstatconv.h
+++ b/libc/sysdeps/linux/common/xstatconv.h
@@ -25,9 +25,11 @@
 #include <features.h>
 #include <bits/kernel_stat.h>
 
+#ifdef __ARCH_HAS_DEPRECATED_SYSCALLS__
 extern void __xstat_conv(struct kernel_stat *kbuf, struct stat *buf) attribute_hidden;
 extern void __xstat32_conv(struct kernel_stat64 *kbuf, struct stat *buf) attribute_hidden;
 #if defined __UCLIBC_HAS_LFS__
 extern void __xstat64_conv(struct kernel_stat64 *kbuf, struct stat64 *buf) attribute_hidden;
 #endif
+#endif
 
-- 
1.7.4.1



More information about the uClibc mailing list