[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#231972: Has a decision been made on this?



severity 231972 normal
thanks

At Mon, 29 Mar 2004 07:53:16 -0500,
Nathanael Nerode wrote:
> Allowing 'long long' in asm/types.h even with __STRICT_ANSI__ may
> not be ideal, but it would work.
> 
> I ask because this is the last RC bug against l-k-h.

In first, I fully agree with Christoph Hellwig's opinion.  We should
use sysconf().  Even if we use PAGE_SIZE for old world application,
asm/types.h is not part of ANSI C.  KDE application sometimes use
-ansi or -pedantic, but glibc does not think we have to handle them
importantly.

Moreover, now kdebase 4:3.2.2-1 can compile on s390:

	http://buildd.debian.org/build.php?&pkg=kdebase&ver=4%3A3.2.2-1&arch=s390&file=log

So I downgrade this bug into normal because of above reasons.


I read the opinion from Philip Blundell:

At Tue, 17 Feb 2004 12:24:36 +0000,
Philip Blundell wrote:
> I think we should just remove the __STRICT_ANSI__ check from
> <asm/types.h>.  "long long" will still work in gcc under -ansi (and, in
> fact, will only elicit a warning even under -pedantic) so there should
> be no real problem here.
> 
> __STRICT_ANSI__'s intended use in header files is to guard
> namespace-polluting declarations that might collide with a conforming
> ANSI program.  Namespace pollution is irrelevant here because the
> identifiers at issue both start with an underscore.

I also fully agreed.  The latest kernel uses __STRICT_ANSI__ in only
types.h and byteorder.h for each architecture.  But there are a lot of
__s64 and __u64 use without __STRICT_ANSI__ ifdefs in the kernel
headers even if that clause is excluded from __KERNEL__.  This means
that we don't care about this problem.  And nowadays we're moving
standard to ISO C99, and that includes "long long".

The only remained problem is: the default standard of gcc 3.3 is not
ISO C99.  But "long long" works with even gcc 2.95.3 (which is at
least required for kernel 2.6 compilation).  So it's not exact
problem.

Attached patch removes all __STRICT_ANSI__ from the latest kernel
2.6.6 and today's bk.  I'll ask it to lkml and put this patch into lkh
cvs, if you have no objection.

Regards,
-- gotom


diff -Nuar linux-2.6.6/include/asm-arm/byteorder.h linux-2.6.6.gotom/include/asm-arm/byteorder.h
--- linux-2.6.6/include/asm-arm/byteorder.h	2004-04-04 12:37:38.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-arm/byteorder.h	2004-05-16 00:58:25.000000000 +0900
@@ -18,10 +18,8 @@
 
 #include <asm/types.h>
 
-#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
-#  define __BYTEORDER_HAS_U64__
-#  define __SWAB_64_THRU_32__
-#endif
+#define __BYTEORDER_HAS_U64__
+#define __SWAB_64_THRU_32__
 
 #ifdef __ARMEB__
 #include <linux/byteorder/big_endian.h>
diff -Nuar linux-2.6.6/include/asm-arm/types.h linux-2.6.6.gotom/include/asm-arm/types.h
--- linux-2.6.6/include/asm-arm/types.h	2004-04-04 12:36:14.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-arm/types.h	2004-05-12 23:03:47.000000000 +0900
@@ -19,10 +19,8 @@
 typedef __signed__ int __s32;
 typedef unsigned int __u32;
 
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
 typedef __signed__ long long __s64;
 typedef unsigned long long __u64;
-#endif
 
 #endif /* __ASSEMBLY__ */
 
diff -Nuar linux-2.6.6/include/asm-arm26/byteorder.h linux-2.6.6.gotom/include/asm-arm26/byteorder.h
--- linux-2.6.6/include/asm-arm26/byteorder.h	2004-04-04 12:37:40.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-arm26/byteorder.h	2004-05-16 00:58:51.000000000 +0900
@@ -13,10 +13,8 @@
 
 #include <asm/types.h>
 
-#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
-#  define __BYTEORDER_HAS_U64__
-#  define __SWAB_64_THRU_32__
-#endif
+#define __BYTEORDER_HAS_U64__
+#define __SWAB_64_THRU_32__
 
 #include <linux/byteorder/little_endian.h>
 
diff -Nuar linux-2.6.6/include/asm-arm26/types.h linux-2.6.6.gotom/include/asm-arm26/types.h
--- linux-2.6.6/include/asm-arm26/types.h	2004-04-04 12:36:13.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-arm26/types.h	2004-05-12 23:03:47.000000000 +0900
@@ -19,10 +19,8 @@
 typedef __signed__ int __s32;
 typedef unsigned int __u32;
 
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
 typedef __signed__ long long __s64;
 typedef unsigned long long __u64;
-#endif
 
 #endif /* __ASSEMBLY__ */
 
diff -Nuar linux-2.6.6/include/asm-cris/byteorder.h linux-2.6.6.gotom/include/asm-cris/byteorder.h
--- linux-2.6.6/include/asm-cris/byteorder.h	2004-04-04 12:36:14.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-cris/byteorder.h	2004-05-16 00:59:11.000000000 +0900
@@ -12,10 +12,8 @@
 #define __arch__swab32(x) ___arch__swab32(x)
 #define __arch__swab16(x) ___arch__swab16(x)
 
-#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
-#  define __BYTEORDER_HAS_U64__
-#  define __SWAB_64_THRU_32__
-#endif
+#define __BYTEORDER_HAS_U64__
+#define __SWAB_64_THRU_32__
 
 #endif /* __GNUC__ */
 
diff -Nuar linux-2.6.6/include/asm-cris/types.h linux-2.6.6.gotom/include/asm-cris/types.h
--- linux-2.6.6/include/asm-cris/types.h	2004-04-04 12:37:23.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-cris/types.h	2004-05-12 23:03:47.000000000 +0900
@@ -19,10 +19,8 @@
 typedef __signed__ int __s32;
 typedef unsigned int __u32;
 
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
 typedef __signed__ long long __s64;
 typedef unsigned long long __u64;
-#endif
 
 #endif /* __ASSEMBLY__ */
 
diff -Nuar linux-2.6.6/include/asm-h8300/byteorder.h linux-2.6.6.gotom/include/asm-h8300/byteorder.h
--- linux-2.6.6/include/asm-h8300/byteorder.h	2004-04-04 12:36:14.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-h8300/byteorder.h	2004-05-16 00:59:34.000000000 +0900
@@ -3,10 +3,8 @@
 
 #include <asm/types.h>
 
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
-#  define __BYTEORDER_HAS_U64__
-#  define __SWAB_64_THRU_32__
-#endif
+#define __BYTEORDER_HAS_U64__
+#define __SWAB_64_THRU_32__
 
 #include <linux/byteorder/big_endian.h>
 
diff -Nuar linux-2.6.6/include/asm-h8300/types.h linux-2.6.6.gotom/include/asm-h8300/types.h
--- linux-2.6.6/include/asm-h8300/types.h	2004-04-04 12:37:27.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-h8300/types.h	2004-05-12 23:03:47.000000000 +0900
@@ -27,10 +27,8 @@
 typedef __signed__ int __s32;
 typedef unsigned int __u32;
 
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
 typedef __signed__ long long __s64;
 typedef unsigned long long __u64;
-#endif
 
 /*
  * These aren't exported outside the kernel to avoid name space clashes
diff -Nuar linux-2.6.6/include/asm-i386/types.h linux-2.6.6.gotom/include/asm-i386/types.h
--- linux-2.6.6/include/asm-i386/types.h	2004-04-04 12:37:23.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-i386/types.h	2004-05-12 23:03:47.000000000 +0900
@@ -19,10 +19,8 @@
 typedef __signed__ int __s32;
 typedef unsigned int __u32;
 
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
 typedef __signed__ long long __s64;
 typedef unsigned long long __u64;
-#endif
 
 #endif /* __ASSEMBLY__ */
 
diff -Nuar linux-2.6.6/include/asm-m68k/byteorder.h linux-2.6.6.gotom/include/asm-m68k/byteorder.h
--- linux-2.6.6/include/asm-m68k/byteorder.h	2004-04-04 12:36:57.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-m68k/byteorder.h	2004-05-16 00:59:58.000000000 +0900
@@ -15,10 +15,8 @@
 
 #endif
 
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
-#  define __BYTEORDER_HAS_U64__
-#  define __SWAB_64_THRU_32__
-#endif
+#define __BYTEORDER_HAS_U64__
+#define __SWAB_64_THRU_32__
 
 #include <linux/byteorder/big_endian.h>
 
diff -Nuar linux-2.6.6/include/asm-m68k/types.h linux-2.6.6.gotom/include/asm-m68k/types.h
--- linux-2.6.6/include/asm-m68k/types.h	2004-04-04 12:36:11.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-m68k/types.h	2004-05-12 23:03:47.000000000 +0900
@@ -27,10 +27,8 @@
 typedef __signed__ int __s32;
 typedef unsigned int __u32;
 
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
 typedef __signed__ long long __s64;
 typedef unsigned long long __u64;
-#endif
 
 #endif /* __ASSEMBLY__ */
 
diff -Nuar linux-2.6.6/include/asm-m68knommu/byteorder.h linux-2.6.6.gotom/include/asm-m68knommu/byteorder.h
--- linux-2.6.6/include/asm-m68knommu/byteorder.h	2004-04-04 12:36:26.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-m68knommu/byteorder.h	2004-05-16 01:00:24.000000000 +0900
@@ -3,10 +3,8 @@
 
 #include <asm/types.h>
 
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
-#  define __BYTEORDER_HAS_U64__
-#  define __SWAB_64_THRU_32__
-#endif
+#define __BYTEORDER_HAS_U64__
+#define __SWAB_64_THRU_32__
 
 #include <linux/byteorder/big_endian.h>
 
diff -Nuar linux-2.6.6/include/asm-mips/byteorder.h linux-2.6.6.gotom/include/asm-mips/byteorder.h
--- linux-2.6.6/include/asm-mips/byteorder.h	2004-04-04 12:37:23.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-mips/byteorder.h	2004-05-16 01:02:16.000000000 +0900
@@ -10,14 +10,8 @@
 
 #include <asm/types.h>
 
-#ifdef __GNUC__
-
-#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
-#  define __BYTEORDER_HAS_U64__
-#  define __SWAB_64_THRU_32__
-#endif
-
-#endif /* __GNUC__ */
+#define __BYTEORDER_HAS_U64__
+#define __SWAB_64_THRU_32__
 
 #if defined (__MIPSEB__)
 #  include <linux/byteorder/big_endian.h>
diff -Nuar linux-2.6.6/include/asm-mips/types.h linux-2.6.6.gotom/include/asm-mips/types.h
--- linux-2.6.6/include/asm-mips/types.h	2004-04-04 12:36:17.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-mips/types.h	2004-05-12 23:03:47.000000000 +0900
@@ -34,10 +34,8 @@
 
 #else
 
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
 typedef __signed__ long long __s64;
 typedef unsigned long long __u64;
-#endif
 
 #endif
 
@@ -70,10 +68,8 @@
 
 #else
 
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
 typedef __signed__ long long s64;
 typedef unsigned long long u64;
-#endif
 
 #endif
 
diff -Nuar linux-2.6.6/include/asm-parisc/byteorder.h linux-2.6.6.gotom/include/asm-parisc/byteorder.h
--- linux-2.6.6/include/asm-parisc/byteorder.h	2004-04-04 12:37:45.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-parisc/byteorder.h	2004-05-12 23:03:47.000000000 +0900
@@ -60,7 +60,7 @@
 }
 #define __arch__swab64(x) ___arch__swab64(x)
 #define __BYTEORDER_HAS_U64__
-#elif !defined(__STRICT_ANSI__)
+#else
 static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 x)
 {
 	__u32 t1 = ___arch__swab32((__u32) x);
diff -Nuar linux-2.6.6/include/asm-parisc/types.h linux-2.6.6.gotom/include/asm-parisc/types.h
--- linux-2.6.6/include/asm-parisc/types.h	2004-04-04 12:36:24.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-parisc/types.h	2004-05-12 23:03:47.000000000 +0900
@@ -19,10 +19,8 @@
 typedef __signed__ int __s32;
 typedef unsigned int __u32;
 
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
 typedef __signed__ long long __s64;
 typedef unsigned long long __u64;
-#endif
 
 #endif /* __ASSEMBLY__ */
 
diff -Nuar linux-2.6.6/include/asm-ppc/byteorder.h linux-2.6.6.gotom/include/asm-ppc/byteorder.h
--- linux-2.6.6/include/asm-ppc/byteorder.h	2004-04-04 12:37:06.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-ppc/byteorder.h	2004-05-16 01:04:35.000000000 +0900
@@ -64,10 +64,8 @@
 
 #endif /* __KERNEL__ */
 
-#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
-#  define __BYTEORDER_HAS_U64__
-#  define __SWAB_64_THRU_32__
-#endif
+#define __BYTEORDER_HAS_U64__
+#define __SWAB_64_THRU_32__
 
 #endif /* __GNUC__ */
 
diff -Nuar linux-2.6.6/include/asm-ppc/types.h linux-2.6.6.gotom/include/asm-ppc/types.h
--- linux-2.6.6/include/asm-ppc/types.h	2004-04-04 12:38:13.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-ppc/types.h	2004-05-12 23:03:47.000000000 +0900
@@ -12,10 +12,8 @@
 typedef __signed__ int __s32;
 typedef unsigned int __u32;
 
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
 typedef __signed__ long long __s64;
 typedef unsigned long long __u64;
-#endif
 
 typedef struct {
 	__u32 u[4];
diff -Nuar linux-2.6.6/include/asm-ppc64/byteorder.h linux-2.6.6.gotom/include/asm-ppc64/byteorder.h
--- linux-2.6.6/include/asm-ppc64/byteorder.h	2004-04-04 12:38:23.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-ppc64/byteorder.h	2004-05-12 23:03:47.000000000 +0900
@@ -85,9 +85,7 @@
 
 #endif /* __KERNEL__ */
 
-#ifndef __STRICT_ANSI__
 #define __BYTEORDER_HAS_U64__
-#endif
 
 #endif /* __GNUC__ */
 
diff -Nuar linux-2.6.6/include/asm-s390/byteorder.h linux-2.6.6.gotom/include/asm-s390/byteorder.h
--- linux-2.6.6/include/asm-s390/byteorder.h	2004-04-04 12:38:23.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-s390/byteorder.h	2004-05-16 01:05:27.000000000 +0900
@@ -116,12 +116,10 @@
 #define __arch__swab16s(x) ___arch__swab16s(x)
 
 #ifndef __s390x__
-#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
 #  define __BYTEORDER_HAS_U64__
 #  define __SWAB_64_THRU_32__
-#endif
 #else /* __s390x__ */
-#define __BYTEORDER_HAS_U64__
+#  define __BYTEORDER_HAS_U64__
 #endif /* __s390x__ */
 
 #endif /* __GNUC__ */
diff -Nuar linux-2.6.6/include/asm-s390/types.h linux-2.6.6.gotom/include/asm-s390/types.h
--- linux-2.6.6/include/asm-s390/types.h	2004-04-04 12:37:07.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-s390/types.h	2004-05-12 23:03:47.000000000 +0900
@@ -28,10 +28,8 @@
 typedef unsigned int __u32;
 
 #ifndef __s390x__
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
 typedef __signed__ long long __s64;
 typedef unsigned long long __u64;
-#endif
 #else /* __s390x__ */
 typedef __signed__ long __s64;
 typedef unsigned long __u64;
diff -Nuar linux-2.6.6/include/asm-sh/byteorder.h linux-2.6.6.gotom/include/asm-sh/byteorder.h
--- linux-2.6.6/include/asm-sh/byteorder.h	2004-04-04 12:36:13.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-sh/byteorder.h	2004-05-16 01:05:47.000000000 +0900
@@ -42,10 +42,8 @@
 #define __arch__swab32(x) ___arch__swab32(x)
 #define __arch__swab16(x) ___arch__swab16(x)
 
-#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
-#  define __BYTEORDER_HAS_U64__
-#  define __SWAB_64_THRU_32__
-#endif
+#define __BYTEORDER_HAS_U64__
+#define __SWAB_64_THRU_32__
 
 #ifdef __LITTLE_ENDIAN__
 #include <linux/byteorder/little_endian.h>
diff -Nuar linux-2.6.6/include/asm-sh/types.h linux-2.6.6.gotom/include/asm-sh/types.h
--- linux-2.6.6/include/asm-sh/types.h	2004-04-04 12:38:15.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-sh/types.h	2004-05-12 23:03:47.000000000 +0900
@@ -19,10 +19,8 @@
 typedef __signed__ int __s32;
 typedef unsigned int __u32;
 
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
 typedef __signed__ long long __s64;
 typedef unsigned long long __u64;
-#endif
 
 #endif /* __ASSEMBLY__ */
 
diff -Nuar linux-2.6.6/include/asm-sparc/byteorder.h linux-2.6.6.gotom/include/asm-sparc/byteorder.h
--- linux-2.6.6/include/asm-sparc/byteorder.h	2004-04-04 12:36:17.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-sparc/byteorder.h	2004-05-16 01:06:04.000000000 +0900
@@ -4,10 +4,8 @@
 
 #include <asm/types.h>
 
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
-#  define __BYTEORDER_HAS_U64__
-#  define __SWAB_64_THRU_32__
-#endif
+#define __BYTEORDER_HAS_U64__
+#define __SWAB_64_THRU_32__
 
 #include <linux/byteorder/big_endian.h>
 
diff -Nuar linux-2.6.6/include/asm-v850/byteorder.h linux-2.6.6.gotom/include/asm-v850/byteorder.h
--- linux-2.6.6/include/asm-v850/byteorder.h	2004-04-04 12:37:42.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-v850/byteorder.h	2004-05-16 01:06:17.000000000 +0900
@@ -36,10 +36,8 @@
 #define __arch__swab32(x) ___arch__swab32(x)
 #define __arch__swab16(x) ___arch__swab16(x)
 
-#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
-#  define __BYTEORDER_HAS_U64__
-#  define __SWAB_64_THRU_32__
-#endif
+#define __BYTEORDER_HAS_U64__
+#define __SWAB_64_THRU_32__
 
 #endif /* __GNUC__ */
 
diff -Nuar linux-2.6.6/include/asm-v850/types.h linux-2.6.6.gotom/include/asm-v850/types.h
--- linux-2.6.6/include/asm-v850/types.h	2004-04-04 12:38:00.000000000 +0900
+++ linux-2.6.6.gotom/include/asm-v850/types.h	2004-05-12 23:03:47.000000000 +0900
@@ -27,10 +27,8 @@
 typedef __signed__ int __s32;
 typedef unsigned int __u32;
 
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
 typedef __signed__ long long __s64;
 typedef unsigned long long __u64;
-#endif
 
 #endif /* !__ASSEMBLY__ */
 
diff -Nuar linux-2.6.6/include/linux/types.h linux-2.6.6.gotom/include/linux/types.h
--- linux-2.6.6/include/linux/types.h	2004-05-12 22:30:36.000000000 +0900
+++ linux-2.6.6.gotom/include/linux/types.h	2004-05-16 01:38:32.000000000 +0900
@@ -51,7 +51,7 @@
 typedef __kernel_gid_t		gid_t;
 #endif /* __KERNEL__ */
 
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#if defined(__GNUC__)
 typedef __kernel_loff_t		loff_t;
 #endif
 
@@ -117,7 +117,7 @@
 typedef		__u16		uint16_t;
 typedef		__u32		uint32_t;
 
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#if defined(__GNUC__)
 typedef		__u64		uint64_t;
 typedef		__u64		u_int64_t;
 typedef		__s64		int64_t;



Reply to: