* Re: __STRICT_ANSI__ checks in headers
[not found] <200609150901.33644.ismail@pardus.org.tr>
@ 2006-09-15 6:42 ` David Woodhouse
2006-09-15 13:27 ` Kyle Moffett
0 siblings, 1 reply; 16+ messages in thread
From: David Woodhouse @ 2006-09-15 6:42 UTC (permalink / raw)
To: Ismail Donmez; +Cc: LKML, mchehab
On Fri, 2006-09-15 at 09:01 +0300, Ismail Donmez wrote:
> Kernel headers currently uses __STRICT_ANSI__ check before defining a long
> long variable because ANSI-C doesn't allow long long variables. But this
> seems to harsh because any project including linux/videodev2.h ( and similar
> ones ) and using -ansi flag will not compile because some types like __s64
> will not be defined.
One possible fix is to let videodev2.h use int64_t, and in userspace
they can include <stdint.h>
Another is just to declare videodev2.h incompatible with -ansi, or maybe
just omit 'value64' from the union if __STRICT_ANSI__ is defined, and
replace it with an array of two __s32s.
--
dwmw2
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: __STRICT_ANSI__ checks in headers
2006-09-15 6:42 ` __STRICT_ANSI__ checks in headers David Woodhouse
@ 2006-09-15 13:27 ` Kyle Moffett
[not found] ` <200609211200.25214.ismail@pardus.org.tr>
0 siblings, 1 reply; 16+ messages in thread
From: Kyle Moffett @ 2006-09-15 13:27 UTC (permalink / raw)
To: David Woodhouse; +Cc: Ismail Donmez, LKML, mchehab
On Sep 15, 2006, at 02:42:58, David Woodhouse wrote:
> On Fri, 2006-09-15 at 09:01 +0300, Ismail Donmez wrote:
>> Kernel headers currently uses __STRICT_ANSI__ check before
>> defining a long
>> long variable because ANSI-C doesn't allow long long variables.
>> But this
>> seems to harsh because any project including linux/videodev2.h
>> ( and similar
>> ones ) and using -ansi flag will not compile because some types
>> like __s64
>> will not be defined.
>
> One possible fix is to let videodev2.h use int64_t, and in userspace
> they can include <stdint.h>
>
> Another is just to declare videodev2.h incompatible with -ansi, or
> maybe
> just omit 'value64' from the union if __STRICT_ANSI__ is defined, and
> replace it with an array of two __s32s.
A mildly better alternative is (on 32-bit architectures, 64-bit archs
have no problem) change the typedef from this:
> #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
> typedef unsigned long long __u64;
> typedef signed long long __s64;
> #endif
to this:
> #if defined(__GNUC__)
> __extension__ typedef unsigned long long __u64;
> __extension__ typedef signed long long __s64;
> #endif
GCC always supports __extension__ to indicate not to warn or error on
GCC-only extensions. You only have to declare __extension__ on the
typedef, any uses are considered OK. I think this also works for
code-expressions like this:
> int x = __extension__ ({ foo(); 1; })
but I don't remember exactly. In certain really complex expressions
GCC can get confused and give bogus errors, but as long as you don't
start sprinkling it in macros you should be fine.
Cheers,
Kyle Moffett
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: __STRICT_ANSI__ checks in headers
[not found] ` <200609211200.25214.ismail@pardus.org.tr>
@ 2006-09-21 9:02 ` David Woodhouse
2006-09-21 12:53 ` Ismail Donmez
0 siblings, 1 reply; 16+ messages in thread
From: David Woodhouse @ 2006-09-21 9:02 UTC (permalink / raw)
To: Ismail Donmez; +Cc: LKML, Kyle Moffett, mchehab
On Thu, 2006-09-21 at 12:00 +0300, Ismail Donmez wrote:
> This looks way cleaner, I can cook up a patch for this if everyone
> agrees. What do you guys think?
Makes sense.
--
dwmw2
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: __STRICT_ANSI__ checks in headers
2006-09-21 9:02 ` David Woodhouse
@ 2006-09-21 12:53 ` Ismail Donmez
2006-09-28 7:03 ` Ismail Donmez
0 siblings, 1 reply; 16+ messages in thread
From: Ismail Donmez @ 2006-09-21 12:53 UTC (permalink / raw)
To: LKML; +Cc: David Woodhouse, Kyle Moffett, mchehab
[-- Attachment #1: Type: text/plain, Size: 826 bytes --]
21 Eyl 2006 Per 12:02 tarihinde, David Woodhouse şunları yazmıştı:
> On Thu, 2006-09-21 at 12:00 +0300, Ismail Donmez wrote:
> > This looks way cleaner, I can cook up a patch for this if everyone
> > agrees. What do you guys think?
>
> Makes sense.
Ok here is patch replacing __STRICT_ANSI__ with __extension__ as suggested by
Kyle Moffett:
__STRICT_ANSI__ usage in types.h header results in compile errors for some
userspace packages[1] when used with gcc -ansi flag. With the suggestion of
Kyle Moffett I replace strict ansi checks with __extension__ to tell gcc not
to error or warn on gcc extensions. Compile tested on x86 with 2.6.18.
[1] kopete and kdetv are such userspace applications.
Signed-off-by: Ismail Donmez <ismail@pardus.org.tr>
--
Insert some japanese signature here
[-- Attachment #2: strict-ansi.patch --]
[-- Type: text/x-diff, Size: 10873 bytes --]
diff --git a/include/asm-arm/types.h b/include/asm-arm/types.h
index 22992ee..3141451 100644
--- a/include/asm-arm/types.h
+++ b/include/asm-arm/types.h
@@ -19,9 +19,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff --git a/include/asm-arm26/types.h b/include/asm-arm26/types.h
index 81bd357..11d8a01 100644
--- a/include/asm-arm26/types.h
+++ b/include/asm-arm26/types.h
@@ -19,9 +19,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff --git a/include/asm-cris/types.h b/include/asm-cris/types.h
index 84557c9..0bc01a9 100644
--- a/include/asm-cris/types.h
+++ b/include/asm-cris/types.h
@@ -19,9 +19,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
@@ -48,7 +48,7 @@ typedef signed long long s64;
typedef unsigned long long u64;
/* Dma addresses are 32-bits wide, just like our other addresses. */
-
+
typedef u32 dma_addr_t;
typedef u32 dma64_addr_t;
diff --git a/include/asm-frv/types.h b/include/asm-frv/types.h
index 1b6d192..767e5ed 100644
--- a/include/asm-frv/types.h
+++ b/include/asm-frv/types.h
@@ -30,9 +30,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff --git a/include/asm-h8300/types.h b/include/asm-h8300/types.h
index da2402b..231d0b1 100644
--- a/include/asm-h8300/types.h
+++ b/include/asm-h8300/types.h
@@ -27,9 +27,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
/*
diff --git a/include/asm-i386/types.h b/include/asm-i386/types.h
index 4b4b295..ef1607d 100644
--- a/include/asm-i386/types.h
+++ b/include/asm-i386/types.h
@@ -19,9 +19,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff --git a/include/asm-m32r/types.h b/include/asm-m32r/types.h
index fcf24c6..8a14833 100644
--- a/include/asm-m32r/types.h
+++ b/include/asm-m32r/types.h
@@ -23,9 +23,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff --git a/include/asm-m68k/types.h b/include/asm-m68k/types.h
index b5a1feb..c35c09d 100644
--- a/include/asm-m68k/types.h
+++ b/include/asm-m68k/types.h
@@ -27,9 +27,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff --git a/include/asm-mips/types.h b/include/asm-mips/types.h
index 2b52e18..d3fb568 100644
--- a/include/asm-mips/types.h
+++ b/include/asm-mips/types.h
@@ -34,9 +34,9 @@ typedef unsigned long __u64;
#else
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif
@@ -69,9 +69,9 @@ typedef unsigned long u64;
#else
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long s64;
-typedef unsigned long long u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long s64;
+__extension__ typedef unsigned long long u64;
#endif
#endif
diff --git a/include/asm-parisc/types.h b/include/asm-parisc/types.h
index 34fdce3..5722ffa 100644
--- a/include/asm-parisc/types.h
+++ b/include/asm-parisc/types.h
@@ -19,9 +19,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff --git a/include/asm-powerpc/types.h b/include/asm-powerpc/types.h
index d6fb56b..ffe0233 100644
--- a/include/asm-powerpc/types.h
+++ b/include/asm-powerpc/types.h
@@ -40,9 +40,9 @@ #ifdef __powerpc64__
typedef __signed__ long __s64;
typedef unsigned long __u64;
#else
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __powerpc64__ */
diff --git a/include/asm-s390/types.h b/include/asm-s390/types.h
index ae2951c..50b7cd0 100644
--- a/include/asm-s390/types.h
+++ b/include/asm-s390/types.h
@@ -28,9 +28,9 @@ typedef __signed__ int __s32;
typedef unsigned int __u32;
#ifndef __s390x__
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#else /* __s390x__ */
typedef __signed__ long __s64;
@@ -38,9 +38,9 @@ typedef unsigned long __u64;
#endif
/* A address type so that arithmetic can be done on it & it can be upgraded to
- 64 bit when necessary
+ 64 bit when necessary
*/
-typedef unsigned long addr_t;
+typedef unsigned long addr_t;
typedef __signed__ long saddr_t;
#endif /* __ASSEMBLY__ */
diff --git a/include/asm-sh/types.h b/include/asm-sh/types.h
index 3c09dd4..574b31d 100644
--- a/include/asm-sh/types.h
+++ b/include/asm-sh/types.h
@@ -19,9 +19,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff --git a/include/asm-sh64/types.h b/include/asm-sh64/types.h
index 8d41db2..2c7ad73 100644
--- a/include/asm-sh64/types.h
+++ b/include/asm-sh64/types.h
@@ -30,9 +30,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff --git a/include/asm-v850/types.h b/include/asm-v850/types.h
index dcef571..284bda8 100644
--- a/include/asm-v850/types.h
+++ b/include/asm-v850/types.h
@@ -27,9 +27,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* !__ASSEMBLY__ */
diff --git a/include/asm-xtensa/types.h b/include/asm-xtensa/types.h
index 9d99a8e..958f362 100644
--- a/include/asm-xtensa/types.h
+++ b/include/asm-xtensa/types.h
@@ -29,9 +29,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
/*
diff --git a/include/linux/types.h b/include/linux/types.h
index 3f23566..4a6be4c 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -52,8 +52,8 @@ typedef __kernel_uid_t uid_t;
typedef __kernel_gid_t gid_t;
#endif /* __KERNEL__ */
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __kernel_loff_t loff_t;
+#if defined(__GNUC__)
+__extension__ typedef __kernel_loff_t loff_t;
#endif
/*
@@ -118,10 +118,10 @@ typedef __u8 uint8_t;
typedef __u16 uint16_t;
typedef __u32 uint32_t;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __u64 uint64_t;
-typedef __u64 u_int64_t;
-typedef __s64 int64_t;
+#if defined(__GNUC__)
+__extension__ typedef __u64 uint64_t;
+__extension__ typedef __u64 u_int64_t;
+__extension__ typedef __s64 int64_t;
#endif
/* this is a special 64bit data type that is 8-byte aligned */
@@ -170,9 +170,9 @@ typedef __u16 __bitwise __le16;
typedef __u16 __bitwise __be16;
typedef __u32 __bitwise __le32;
typedef __u32 __bitwise __be32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __u64 __bitwise __le64;
-typedef __u64 __bitwise __be64;
+#if defined(__GNUC__)
+__extension__ typedef __u64 __bitwise __le64;
+__extension__ typedef __u64 __bitwise __be64;
#endif
#ifdef __KERNEL__
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: __STRICT_ANSI__ checks in headers
2006-09-21 12:53 ` Ismail Donmez
@ 2006-09-28 7:03 ` Ismail Donmez
2006-09-28 7:06 ` David Woodhouse
0 siblings, 1 reply; 16+ messages in thread
From: Ismail Donmez @ 2006-09-28 7:03 UTC (permalink / raw)
To: LKML; +Cc: David Woodhouse, Kyle Moffett, mchehab
[-- Attachment #1: Type: text/plain, Size: 1188 bytes --]
21 Eyl 2006 Per 15:53 tarihinde, Ismail Donmez şunları yazmıştı:
> 21 Eyl 2006 Per 12:02 tarihinde, David Woodhouse şunları yazmıştı:
> > On Thu, 2006-09-21 at 12:00 +0300, Ismail Donmez wrote:
> > > This looks way cleaner, I can cook up a patch for this if everyone
> > > agrees. What do you guys think?
> >
> > Makes sense.
>
> Ok here is patch replacing __STRICT_ANSI__ with __extension__ as suggested
> by Kyle Moffett:
>
> __STRICT_ANSI__ usage in types.h header results in compile errors for some
> userspace packages[1] when used with gcc -ansi flag. With the suggestion of
> Kyle Moffett I replace strict ansi checks with __extension__ to tell gcc
> not to error or warn on gcc extensions. Compile tested on x86 with 2.6.18.
>
> [1] kopete and kdetv are such userspace applications.
>
> Signed-off-by: Ismail Donmez <ismail@pardus.org.tr>
David, is this ok? It would be good to apply this for 2.6.19 so all of KDE
would compile ( all of the parts I tested ) with kernel-headers.
Regards,
ismail
--
They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety.
-- Benjamin Franklin
[-- Attachment #2: strict-ansi.patch --]
[-- Type: text/x-diff, Size: 10873 bytes --]
diff --git a/include/asm-arm/types.h b/include/asm-arm/types.h
index 22992ee..3141451 100644
--- a/include/asm-arm/types.h
+++ b/include/asm-arm/types.h
@@ -19,9 +19,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff --git a/include/asm-arm26/types.h b/include/asm-arm26/types.h
index 81bd357..11d8a01 100644
--- a/include/asm-arm26/types.h
+++ b/include/asm-arm26/types.h
@@ -19,9 +19,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff --git a/include/asm-cris/types.h b/include/asm-cris/types.h
index 84557c9..0bc01a9 100644
--- a/include/asm-cris/types.h
+++ b/include/asm-cris/types.h
@@ -19,9 +19,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
@@ -48,7 +48,7 @@ typedef signed long long s64;
typedef unsigned long long u64;
/* Dma addresses are 32-bits wide, just like our other addresses. */
-
+
typedef u32 dma_addr_t;
typedef u32 dma64_addr_t;
diff --git a/include/asm-frv/types.h b/include/asm-frv/types.h
index 1b6d192..767e5ed 100644
--- a/include/asm-frv/types.h
+++ b/include/asm-frv/types.h
@@ -30,9 +30,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff --git a/include/asm-h8300/types.h b/include/asm-h8300/types.h
index da2402b..231d0b1 100644
--- a/include/asm-h8300/types.h
+++ b/include/asm-h8300/types.h
@@ -27,9 +27,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
/*
diff --git a/include/asm-i386/types.h b/include/asm-i386/types.h
index 4b4b295..ef1607d 100644
--- a/include/asm-i386/types.h
+++ b/include/asm-i386/types.h
@@ -19,9 +19,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff --git a/include/asm-m32r/types.h b/include/asm-m32r/types.h
index fcf24c6..8a14833 100644
--- a/include/asm-m32r/types.h
+++ b/include/asm-m32r/types.h
@@ -23,9 +23,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff --git a/include/asm-m68k/types.h b/include/asm-m68k/types.h
index b5a1feb..c35c09d 100644
--- a/include/asm-m68k/types.h
+++ b/include/asm-m68k/types.h
@@ -27,9 +27,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff --git a/include/asm-mips/types.h b/include/asm-mips/types.h
index 2b52e18..d3fb568 100644
--- a/include/asm-mips/types.h
+++ b/include/asm-mips/types.h
@@ -34,9 +34,9 @@ typedef unsigned long __u64;
#else
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif
@@ -69,9 +69,9 @@ typedef unsigned long u64;
#else
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long s64;
-typedef unsigned long long u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long s64;
+__extension__ typedef unsigned long long u64;
#endif
#endif
diff --git a/include/asm-parisc/types.h b/include/asm-parisc/types.h
index 34fdce3..5722ffa 100644
--- a/include/asm-parisc/types.h
+++ b/include/asm-parisc/types.h
@@ -19,9 +19,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff --git a/include/asm-powerpc/types.h b/include/asm-powerpc/types.h
index d6fb56b..ffe0233 100644
--- a/include/asm-powerpc/types.h
+++ b/include/asm-powerpc/types.h
@@ -40,9 +40,9 @@ #ifdef __powerpc64__
typedef __signed__ long __s64;
typedef unsigned long __u64;
#else
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __powerpc64__ */
diff --git a/include/asm-s390/types.h b/include/asm-s390/types.h
index ae2951c..50b7cd0 100644
--- a/include/asm-s390/types.h
+++ b/include/asm-s390/types.h
@@ -28,9 +28,9 @@ typedef __signed__ int __s32;
typedef unsigned int __u32;
#ifndef __s390x__
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#else /* __s390x__ */
typedef __signed__ long __s64;
@@ -38,9 +38,9 @@ typedef unsigned long __u64;
#endif
/* A address type so that arithmetic can be done on it & it can be upgraded to
- 64 bit when necessary
+ 64 bit when necessary
*/
-typedef unsigned long addr_t;
+typedef unsigned long addr_t;
typedef __signed__ long saddr_t;
#endif /* __ASSEMBLY__ */
diff --git a/include/asm-sh/types.h b/include/asm-sh/types.h
index 3c09dd4..574b31d 100644
--- a/include/asm-sh/types.h
+++ b/include/asm-sh/types.h
@@ -19,9 +19,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff --git a/include/asm-sh64/types.h b/include/asm-sh64/types.h
index 8d41db2..2c7ad73 100644
--- a/include/asm-sh64/types.h
+++ b/include/asm-sh64/types.h
@@ -30,9 +30,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff --git a/include/asm-v850/types.h b/include/asm-v850/types.h
index dcef571..284bda8 100644
--- a/include/asm-v850/types.h
+++ b/include/asm-v850/types.h
@@ -27,9 +27,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* !__ASSEMBLY__ */
diff --git a/include/asm-xtensa/types.h b/include/asm-xtensa/types.h
index 9d99a8e..958f362 100644
--- a/include/asm-xtensa/types.h
+++ b/include/asm-xtensa/types.h
@@ -29,9 +29,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
/*
diff --git a/include/linux/types.h b/include/linux/types.h
index 3f23566..4a6be4c 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -52,8 +52,8 @@ typedef __kernel_uid_t uid_t;
typedef __kernel_gid_t gid_t;
#endif /* __KERNEL__ */
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __kernel_loff_t loff_t;
+#if defined(__GNUC__)
+__extension__ typedef __kernel_loff_t loff_t;
#endif
/*
@@ -118,10 +118,10 @@ typedef __u8 uint8_t;
typedef __u16 uint16_t;
typedef __u32 uint32_t;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __u64 uint64_t;
-typedef __u64 u_int64_t;
-typedef __s64 int64_t;
+#if defined(__GNUC__)
+__extension__ typedef __u64 uint64_t;
+__extension__ typedef __u64 u_int64_t;
+__extension__ typedef __s64 int64_t;
#endif
/* this is a special 64bit data type that is 8-byte aligned */
@@ -170,9 +170,9 @@ typedef __u16 __bitwise __le16;
typedef __u16 __bitwise __be16;
typedef __u32 __bitwise __le32;
typedef __u32 __bitwise __be32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __u64 __bitwise __le64;
-typedef __u64 __bitwise __be64;
+#if defined(__GNUC__)
+__extension__ typedef __u64 __bitwise __le64;
+__extension__ typedef __u64 __bitwise __be64;
#endif
#ifdef __KERNEL__
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: __STRICT_ANSI__ checks in headers
2006-09-28 7:03 ` Ismail Donmez
@ 2006-09-28 7:06 ` David Woodhouse
2006-09-28 7:30 ` Ismail Donmez
0 siblings, 1 reply; 16+ messages in thread
From: David Woodhouse @ 2006-09-28 7:06 UTC (permalink / raw)
To: Ismail Donmez; +Cc: LKML, Kyle Moffett, mchehab
On Thu, 2006-09-28 at 10:03 +0300, Ismail Donmez wrote:
> David, is this ok? It would be good to apply this for 2.6.19 so all of KDE
> would compile ( all of the parts I tested ) with kernel-headers.
Looks good to me.
--
dwmw2
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: __STRICT_ANSI__ checks in headers
2006-09-28 7:06 ` David Woodhouse
@ 2006-09-28 7:30 ` Ismail Donmez
2006-10-01 4:53 ` Andrew Morton
0 siblings, 1 reply; 16+ messages in thread
From: Ismail Donmez @ 2006-09-28 7:30 UTC (permalink / raw)
To: Andrew Morton; +Cc: David Woodhouse, LKML, Kyle Moffett, mchehab
28 Eyl 2006 Per 10:06 tarihinde, David Woodhouse şunları yazmıştı:
> On Thu, 2006-09-28 at 10:03 +0300, Ismail Donmez wrote:
> > David, is this ok? It would be good to apply this for 2.6.19 so all of
> > KDE would compile ( all of the parts I tested ) with kernel-headers.
>
> Looks good to me.
Andrew, now that David gave his blessing , can you push this for 2.6.19?
Regards,
ismail
--
They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety.
-- Benjamin Franklin
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: __STRICT_ANSI__ checks in headers
2006-09-28 7:30 ` Ismail Donmez
@ 2006-10-01 4:53 ` Andrew Morton
2006-10-01 5:20 ` Kyle Moffett
0 siblings, 1 reply; 16+ messages in thread
From: Andrew Morton @ 2006-10-01 4:53 UTC (permalink / raw)
To: Ismail Donmez; +Cc: David Woodhouse, LKML, Kyle Moffett, mchehab
On Thu, 28 Sep 2006 10:30:25 +0300
Ismail Donmez <ismail@pardus.org.tr> wrote:
> 28 Eyl 2006 Per 10:06 tarihinde, David Woodhouse şunları yazmıştı:
> > On Thu, 2006-09-28 at 10:03 +0300, Ismail Donmez wrote:
> > > David, is this ok? It would be good to apply this for 2.6.19 so all of
> > > KDE would compile ( all of the parts I tested ) with kernel-headers.
> >
> > Looks good to me.
>
> Andrew, now that David gave his blessing , can you push this for 2.6.19?
>
Bisection shows that this patch causes these depmod warnings:
WARNING: "snd_card_disconnect" [sound/usb/usx2y/snd-usb-usx2y.ko] has no CRC!
WARNING: "snd_card_disconnect" [sound/usb/snd-usb-audio.ko] has no CRC!
WARNING: "snd_card_disconnect" [sound/drivers/mpu401/snd-mpu401.ko] has no CRC!
WARNING: "no_llseek" [net/sunrpc/sunrpc.ko] has no CRC!
WARNING: "seq_lseek" [net/sunrpc/sunrpc.ko] has no CRC!
WARNING: "seq_lseek" [net/sctp/sctp.ko] has no CRC!
WARNING: "seq_lseek" [net/netfilter/x_tables.ko] has no CRC!
WARNING: "seq_lseek" [net/netfilter/nfnetlink_queue.ko] has no CRC!
WARNING: "seq_lseek" [net/netfilter/nfnetlink_log.ko] has no CRC!
WARNING: "seq_lseek" [net/ipv4/netfilter/ipt_hashlimit.ko] has no CRC!
WARNING: "seq_lseek" [net/ipv4/netfilter/ipt_CLUSTERIP.ko] has no CRC!
WARNING: "seq_lseek" [net/ipv4/netfilter/ip_conntrack.ko] has no CRC!
WARNING: "generic_file_llseek" [fs/ufs/ufs.ko] has no CRC!
WARNING: "remote_llseek" [fs/smbfs/smbfs.ko] has no CRC!
WARNING: "generic_file_llseek" [fs/ntfs/ntfs.ko] has no CRC!
WARNING: "vfs_llseek" [fs/nfsd/nfsd.ko] has no CRC!
WARNING: "seq_lseek" [fs/nfsd/nfsd.ko] has no CRC!
WARNING: "remote_llseek" [fs/nfs/nfs.ko] has no CRC!
[etc]
I don't know why that would happen.
http://www.zip.com.au/~akpm/linux/patches/stuff/config-sony
From: Ismail Donmez <ismail@pardus.org.tr>
__STRICT_ANSI__ usage in types.h header results in compile errors for some
userspace packages[1] when used with gcc -ansi flag. With the suggestion
of Kyle Moffett I replace strict ansi checks with __extension__ to tell gcc
not to error or warn on gcc extensions. Compile tested on x86 with 2.6.18.
[1] kopete and kdetv are such userspace applications.
Signed-off-by: Ismail Donmez <ismail@pardus.org.tr>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Cc: Kyle Moffett <mrmacman_g4@mac.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---
include/asm-arm/types.h | 6 +++---
include/asm-arm26/types.h | 6 +++---
include/asm-cris/types.h | 8 ++++----
include/asm-frv/types.h | 6 +++---
include/asm-h8300/types.h | 6 +++---
include/asm-i386/types.h | 6 +++---
include/asm-m32r/types.h | 6 +++---
include/asm-m68k/types.h | 6 +++---
include/asm-mips/types.h | 12 ++++++------
include/asm-parisc/types.h | 6 +++---
include/asm-powerpc/types.h | 6 +++---
include/asm-s390/types.h | 10 +++++-----
include/asm-sh/types.h | 6 +++---
include/asm-sh64/types.h | 6 +++---
include/asm-v850/types.h | 6 +++---
include/asm-xtensa/types.h | 6 +++---
include/linux/types.h | 18 +++++++++---------
17 files changed, 63 insertions(+), 63 deletions(-)
diff -puN include/asm-arm/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__ include/asm-arm/types.h
--- a/include/asm-arm/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__
+++ a/include/asm-arm/types.h
@@ -19,9 +19,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff -puN include/asm-arm26/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__ include/asm-arm26/types.h
--- a/include/asm-arm26/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__
+++ a/include/asm-arm26/types.h
@@ -19,9 +19,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff -puN include/asm-cris/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__ include/asm-cris/types.h
--- a/include/asm-cris/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__
+++ a/include/asm-cris/types.h
@@ -19,9 +19,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
@@ -48,7 +48,7 @@ typedef signed long long s64;
typedef unsigned long long u64;
/* Dma addresses are 32-bits wide, just like our other addresses. */
-
+
typedef u32 dma_addr_t;
typedef u32 dma64_addr_t;
diff -puN include/asm-frv/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__ include/asm-frv/types.h
--- a/include/asm-frv/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__
+++ a/include/asm-frv/types.h
@@ -30,9 +30,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff -puN include/asm-h8300/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__ include/asm-h8300/types.h
--- a/include/asm-h8300/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__
+++ a/include/asm-h8300/types.h
@@ -27,9 +27,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
/*
diff -puN include/asm-i386/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__ include/asm-i386/types.h
--- a/include/asm-i386/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__
+++ a/include/asm-i386/types.h
@@ -19,9 +19,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff -puN include/asm-m32r/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__ include/asm-m32r/types.h
--- a/include/asm-m32r/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__
+++ a/include/asm-m32r/types.h
@@ -23,9 +23,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff -puN include/asm-m68k/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__ include/asm-m68k/types.h
--- a/include/asm-m68k/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__
+++ a/include/asm-m68k/types.h
@@ -27,9 +27,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff -puN include/asm-mips/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__ include/asm-mips/types.h
--- a/include/asm-mips/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__
+++ a/include/asm-mips/types.h
@@ -34,9 +34,9 @@ typedef unsigned long __u64;
#else
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif
@@ -69,9 +69,9 @@ typedef unsigned long u64;
#else
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long s64;
-typedef unsigned long long u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long s64;
+__extension__ typedef unsigned long long u64;
#endif
#endif
diff -puN include/asm-parisc/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__ include/asm-parisc/types.h
--- a/include/asm-parisc/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__
+++ a/include/asm-parisc/types.h
@@ -19,9 +19,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff -puN include/asm-powerpc/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__ include/asm-powerpc/types.h
--- a/include/asm-powerpc/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__
+++ a/include/asm-powerpc/types.h
@@ -40,9 +40,9 @@ typedef unsigned int __u32;
typedef __signed__ long __s64;
typedef unsigned long __u64;
#else
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __powerpc64__ */
diff -puN include/asm-s390/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__ include/asm-s390/types.h
--- a/include/asm-s390/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__
+++ a/include/asm-s390/types.h
@@ -28,9 +28,9 @@ typedef __signed__ int __s32;
typedef unsigned int __u32;
#ifndef __s390x__
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#else /* __s390x__ */
typedef __signed__ long __s64;
@@ -38,9 +38,9 @@ typedef unsigned long __u64;
#endif
/* A address type so that arithmetic can be done on it & it can be upgraded to
- 64 bit when necessary
+ 64 bit when necessary
*/
-typedef unsigned long addr_t;
+typedef unsigned long addr_t;
typedef __signed__ long saddr_t;
#endif /* __ASSEMBLY__ */
diff -puN include/asm-sh/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__ include/asm-sh/types.h
--- a/include/asm-sh/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__
+++ a/include/asm-sh/types.h
@@ -19,9 +19,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff -puN include/asm-sh64/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__ include/asm-sh64/types.h
--- a/include/asm-sh64/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__
+++ a/include/asm-sh64/types.h
@@ -30,9 +30,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* __ASSEMBLY__ */
diff -puN include/asm-v850/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__ include/asm-v850/types.h
--- a/include/asm-v850/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__
+++ a/include/asm-v850/types.h
@@ -27,9 +27,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
#endif /* !__ASSEMBLY__ */
diff -puN include/asm-xtensa/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__ include/asm-xtensa/types.h
--- a/include/asm-xtensa/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__
+++ a/include/asm-xtensa/types.h
@@ -29,9 +29,9 @@ typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
+#if defined(__GNUC__)
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
#endif
/*
diff -puN include/linux/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__ include/linux/types.h
--- a/include/linux/types.h~fix-compile-errors-for-64-bit-types-in-headers-with-__strict_ansi__
+++ a/include/linux/types.h
@@ -54,8 +54,8 @@ typedef __kernel_uid_t uid_t;
typedef __kernel_gid_t gid_t;
#endif /* __KERNEL__ */
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __kernel_loff_t loff_t;
+#if defined(__GNUC__)
+__extension__ typedef __kernel_loff_t loff_t;
#endif
/*
@@ -120,10 +120,10 @@ typedef __u8 uint8_t;
typedef __u16 uint16_t;
typedef __u32 uint32_t;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __u64 uint64_t;
-typedef __u64 u_int64_t;
-typedef __s64 int64_t;
+#if defined(__GNUC__)
+__extension__ typedef __u64 uint64_t;
+__extension__ typedef __u64 u_int64_t;
+__extension__ typedef __s64 int64_t;
#endif
/* this is a special 64bit data type that is 8-byte aligned */
@@ -172,9 +172,9 @@ typedef __u16 __bitwise __le16;
typedef __u16 __bitwise __be16;
typedef __u32 __bitwise __le32;
typedef __u32 __bitwise __be32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __u64 __bitwise __le64;
-typedef __u64 __bitwise __be64;
+#if defined(__GNUC__)
+__extension__ typedef __u64 __bitwise __le64;
+__extension__ typedef __u64 __bitwise __be64;
#endif
#ifdef __KERNEL__
_
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: __STRICT_ANSI__ checks in headers
2006-10-01 4:53 ` Andrew Morton
@ 2006-10-01 5:20 ` Kyle Moffett
2006-10-01 7:34 ` Ismail Donmez
0 siblings, 1 reply; 16+ messages in thread
From: Kyle Moffett @ 2006-10-01 5:20 UTC (permalink / raw)
To: Andrew Morton; +Cc: Ismail Donmez, David Woodhouse, LKML, mchehab
On Oct 01, 2006, at 00:53:43, Andrew Morton wrote:
> On Thu, 28 Sep 2006 10:30:25 +0300
> Ismail Donmez <ismail@pardus.org.tr> wrote:
>
>> 28 Eyl 2006 Per 10:06 tarihinde, David Woodhouse şunları
>> yazmıştı:
>>> On Thu, 2006-09-28 at 10:03 +0300, Ismail Donmez wrote:
>>> David, is this ok? It would be good to apply this for 2.6.19 so
>>> all of KDE would compile ( all of the parts I tested ) with
>>> kernel-headers.
>>>
>>> Looks good to me.
>>
>> Andrew, now that David gave his blessing , can you push this for
>> 2.6.19?
>>
>
> Bisection shows that this patch causes these depmod warnings:
>
> WARNING: "snd_card_disconnect" [sound/usb/usx2y/snd-usb-usx2y.ko]
> has no CRC!
> [etc]
>
> I don't know why that would happen.
>
> From: Ismail Donmez <ismail@pardus.org.tr>
>
> __STRICT_ANSI__ usage in types.h header results in compile errors
> for some userspace packages[1] when used with gcc -ansi flag. With
> the suggestion of Kyle Moffett I replace strict ansi checks with
> __extension__ to tell gcc not to error or warn on gcc extensions.
> Compile tested on x86 with 2.6.18.
Best guess: Depmod does some kind of funny type-based expansion and
hashing of the symbols which doesn't understand the "__extension__"
keyword. Probably the simplest thing to do is to add "-
D__extension__=" to the depmod preprocessing flags. Alternatively
you could teach depmod to completely ignore the __extension__ keyword
when it shows up in the sources, but the former seems like it would
be much simpler.
Just thinking about it we probably also need to educate sparse about
__extension__ too. Perhaps somebody could also add an sparse flag to
make it warn about nonportable constructs in exported header files.
I'd submit a patch but my knowledge of kernel makefiles and depmod is
somewhere between zero and none, exclusive.
Cheers,
Kyle Moffett
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: __STRICT_ANSI__ checks in headers
2006-10-01 5:20 ` Kyle Moffett
@ 2006-10-01 7:34 ` Ismail Donmez
2006-10-01 9:14 ` Sam Ravnborg
0 siblings, 1 reply; 16+ messages in thread
From: Ismail Donmez @ 2006-10-01 7:34 UTC (permalink / raw)
To: Kyle Moffett; +Cc: Andrew Morton, David Woodhouse, LKML, mchehab
On Sunday 01 October 2006 08:20, Kyle Moffett wrote:
> On Oct 01, 2006, at 00:53:43, Andrew Morton wrote:
[...]
> > Bisection shows that this patch causes these depmod warnings:
> >
> > WARNING: "snd_card_disconnect" [sound/usb/usx2y/snd-usb-usx2y.ko]
> > has no CRC!
> > [etc]
> >
> > I don't know why that would happen.
> >
> > From: Ismail Donmez <ismail@pardus.org.tr>
> >
> > __STRICT_ANSI__ usage in types.h header results in compile errors
> > for some userspace packages[1] when used with gcc -ansi flag. With
> > the suggestion of Kyle Moffett I replace strict ansi checks with
> > __extension__ to tell gcc not to error or warn on gcc extensions.
> > Compile tested on x86 with 2.6.18.
>
> Best guess: Depmod does some kind of funny type-based expansion and
> hashing of the symbols which doesn't understand the "__extension__"
> keyword. Probably the simplest thing to do is to add "-
> D__extension__=" to the depmod preprocessing flags. Alternatively
> you could teach depmod to completely ignore the __extension__ keyword
> when it shows up in the sources, but the former seems like it would
> be much simpler.
>
> Just thinking about it we probably also need to educate sparse about
> __extension__ too. Perhaps somebody could also add an sparse flag to
> make it warn about nonportable constructs in exported header files.
>
> I'd submit a patch but my knowledge of kernel makefiles and depmod is
> somewhere between zero and none, exclusive.
Thanks, I will have a look at it.
Regards,
ismail
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: __STRICT_ANSI__ checks in headers
2006-10-01 7:34 ` Ismail Donmez
@ 2006-10-01 9:14 ` Sam Ravnborg
2006-10-01 12:54 ` Ismail Donmez
2006-10-05 8:16 ` Ismail Donmez
0 siblings, 2 replies; 16+ messages in thread
From: Sam Ravnborg @ 2006-10-01 9:14 UTC (permalink / raw)
To: Ismail Donmez; +Cc: Kyle Moffett, Andrew Morton, David Woodhouse, LKML, mchehab
On Sun, Oct 01, 2006 at 10:34:56AM +0300, Ismail Donmez wrote:
> On Sunday 01 October 2006 08:20, Kyle Moffett wrote:
> > On Oct 01, 2006, at 00:53:43, Andrew Morton wrote:
> [...]
> > > Bisection shows that this patch causes these depmod warnings:
> > >
> > > WARNING: "snd_card_disconnect" [sound/usb/usx2y/snd-usb-usx2y.ko]
> > > has no CRC!
> > > [etc]
> > >
> > > I don't know why that would happen.
> > >
> > > From: Ismail Donmez <ismail@pardus.org.tr>
> > >
> > > __STRICT_ANSI__ usage in types.h header results in compile errors
> > > for some userspace packages[1] when used with gcc -ansi flag. With
> > > the suggestion of Kyle Moffett I replace strict ansi checks with
> > > __extension__ to tell gcc not to error or warn on gcc extensions.
> > > Compile tested on x86 with 2.6.18.
> >
> > Best guess: Depmod does some kind of funny type-based expansion and
> > hashing of the symbols which doesn't understand the "__extension__"
> > keyword. Probably the simplest thing to do is to add "-
> > D__extension__=" to the depmod preprocessing flags. Alternatively
> > you could teach depmod to completely ignore the __extension__ keyword
> > when it shows up in the sources, but the former seems like it would
> > be much simpler.
> >
> > Just thinking about it we probably also need to educate sparse about
> > __extension__ too. Perhaps somebody could also add an sparse flag to
> > make it warn about nonportable constructs in exported header files.
> >
> > I'd submit a patch but my knowledge of kernel makefiles and depmod is
> > somewhere between zero and none, exclusive.
>
> Thanks, I will have a look at it.
I assume you will same errors from the in-kernel modpost.
If you do not do so then there is some inconsistency between depmod
and modpost that ougth to be fixed.
I'm not up to the task atm - busy with my day job and travelling a lot
Sam
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: __STRICT_ANSI__ checks in headers
2006-10-01 9:14 ` Sam Ravnborg
@ 2006-10-01 12:54 ` Ismail Donmez
2006-10-05 8:16 ` Ismail Donmez
1 sibling, 0 replies; 16+ messages in thread
From: Ismail Donmez @ 2006-10-01 12:54 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: Kyle Moffett, Andrew Morton, David Woodhouse, LKML, mchehab
On Sunday 01 October 2006 12:14, Sam Ravnborg wrote:
[...]
> > Thanks, I will have a look at it.
>
> I assume you will same errors from the in-kernel modpost.
> If you do not do so then there is some inconsistency between depmod
> and modpost that ougth to be fixed.
>
I didn't see any errors when I did the build, I will try to reproduce and fix
the issue.
Regards,
ismail
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: __STRICT_ANSI__ checks in headers
2006-10-01 9:14 ` Sam Ravnborg
2006-10-01 12:54 ` Ismail Donmez
@ 2006-10-05 8:16 ` Ismail Donmez
2006-10-05 8:56 ` Kyle Moffett
2006-10-06 8:26 ` David Woodhouse
1 sibling, 2 replies; 16+ messages in thread
From: Ismail Donmez @ 2006-10-05 8:16 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: Kyle Moffett, Andrew Morton, David Woodhouse, LKML, mchehab
01 Eki 2006 Paz 12:14 tarihinde, Sam Ravnborg şunları yazmıştı:
> On Sun, Oct 01, 2006 at 10:34:56AM +0300, Ismail Donmez wrote:
> > On Sunday 01 October 2006 08:20, Kyle Moffett wrote:
[...]
> > > Just thinking about it we probably also need to educate sparse about
> > > __extension__ too. Perhaps somebody could also add an sparse flag to
> > > make it warn about nonportable constructs in exported header files.
> > >
> > > I'd submit a patch but my knowledge of kernel makefiles and depmod is
> > > somewhere between zero and none, exclusive.
> >
> > Thanks, I will have a look at it.
>
> I assume you will same errors from the in-kernel modpost.
> If you do not do so then there is some inconsistency between depmod
> and modpost that ougth to be fixed.
The problem shows itself in the modpost, somehow __extension__ clause seems to
foobar module CRC. I am not yet successfull on making modpost ignore
__extension__ .
Any ideas appreciated.
Regards,
ismail
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: __STRICT_ANSI__ checks in headers
2006-10-05 8:16 ` Ismail Donmez
@ 2006-10-05 8:56 ` Kyle Moffett
2006-10-06 8:26 ` David Woodhouse
1 sibling, 0 replies; 16+ messages in thread
From: Kyle Moffett @ 2006-10-05 8:56 UTC (permalink / raw)
To: Ismail Donmez; +Cc: Sam Ravnborg, Andrew Morton, David Woodhouse, LKML, mchehab
I'm away from my regular work systems at the moment, but I have a
couple ideas:
On Oct 05, 2006, at 04:16:11, Ismail Donmez wrote:
> 01 Eki 2006 Paz 12:14 tarihinde, Sam Ravnborg şunları yazmıştı:
>> On Sun, Oct 01, 2006 at 10:34:56AM +0300, Ismail Donmez wrote:
>>> On Sunday 01 October 2006 08:20, Kyle Moffett wrote:
> [...]
>>>> Just thinking about it we probably also need to educate sparse
>>>> about
>>>> __extension__ too. Perhaps somebody could also add an sparse
>>>> flag to
>>>> make it warn about nonportable constructs in exported header files.
>>>>
>>>> I'd submit a patch but my knowledge of kernel makefiles and
>>>> depmod is
>>>> somewhere between zero and none, exclusive.
>>>
>>> Thanks, I will have a look at it.
>>
>> I assume you will same errors from the in-kernel modpost.
>> If you do not do so then there is some inconsistency between depmod
>> and modpost that ougth to be fixed.
>
> The problem shows itself in the modpost, somehow __extension__
> clause seems to
> foobar module CRC. I am not yet successfull on making modpost ignore
> __extension__ .
Since GCC doesn't actually _do_ anything with __extension__ in the
object output files, it must be a C-file-based parser problem, so you
should probably be able to build one of the problematic modules and
diff the resultant .cmd files, the .mod files, and the .mod.c files.
Sorry I can't be of more help.
Cheers,
Kyle Moffett
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: __STRICT_ANSI__ checks in headers
2006-10-05 8:16 ` Ismail Donmez
2006-10-05 8:56 ` Kyle Moffett
@ 2006-10-06 8:26 ` David Woodhouse
2006-10-07 7:17 ` Kyle Moffett
1 sibling, 1 reply; 16+ messages in thread
From: David Woodhouse @ 2006-10-06 8:26 UTC (permalink / raw)
To: Ismail Donmez; +Cc: Sam Ravnborg, Kyle Moffett, Andrew Morton, LKML, mchehab
On Thu, 2006-10-05 at 11:16 +0300, Ismail Donmez wrote:
> The problem shows itself in the modpost, somehow __extension__ clause seems to
> foobar module CRC. I am not yet successfull on making modpost ignore
> __extension__ .
>
> Any ideas appreciated.
Something like this (and build with GENERATE_PARSER=1) _ought_ to do it,
but doesn't work:
diff --git a/scripts/genksyms/keywords.gperf b/scripts/genksyms/keywords.gperf
index c75e0c8..1c31f38 100644
--- a/scripts/genksyms/keywords.gperf
+++ b/scripts/genksyms/keywords.gperf
@@ -11,6 +11,7 @@ __attribute, ATTRIBUTE_KEYW
__attribute__, ATTRIBUTE_KEYW
__const, CONST_KEYW
__const__, CONST_KEYW
+__extension__,EXTENSION_KEYW
__inline, INLINE_KEYW
__inline__, INLINE_KEYW
__signed, SIGNED_KEYW
diff --git a/scripts/genksyms/parse.y b/scripts/genksyms/parse.y
index ca04c94..66ae413 100644
--- a/scripts/genksyms/parse.y
+++ b/scripts/genksyms/parse.y
@@ -60,6 +60,7 @@ remove_list(struct string_list **pb, str
%token CONST_KEYW
%token DOUBLE_KEYW
%token ENUM_KEYW
+%token EXTENSION_KEYW
%token EXTERN_KEYW
%token FLOAT_KEYW
%token INLINE_KEYW
@@ -269,7 +270,7 @@ cvar_qualifier_seq:
cvar_qualifier:
CONST_KEYW | VOLATILE_KEYW | ATTRIBUTE_PHRASE
- | RESTRICT_KEYW
+ | RESTRICT_KEYW | EXTENSION_KEYW
{ /* restrict has no effect in prototypes so ignore it */
remove_node($1);
$$ = $1;
--
dwmw2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: __STRICT_ANSI__ checks in headers
2006-10-06 8:26 ` David Woodhouse
@ 2006-10-07 7:17 ` Kyle Moffett
0 siblings, 0 replies; 16+ messages in thread
From: Kyle Moffett @ 2006-10-07 7:17 UTC (permalink / raw)
To: David Woodhouse; +Cc: Ismail Donmez, Sam Ravnborg, Andrew Morton, LKML, mchehab
On Oct 06, 2006, at 04:26:22, David Woodhouse wrote:
> On Thu, 2006-10-05 at 11:16 +0300, Ismail Donmez wrote:
>> The problem shows itself in the modpost, somehow __extension__
>> clause seems to foobar module CRC. I am not yet successfull on
>> making modpost ignore
>> __extension__ .
>>
>> Any ideas appreciated.
>
> Something like this (and build with GENERATE_PARSER=1) _ought_ to
> do it,
> but doesn't work:
>
> @@ -269,7 +270,7 @@ cvar_qualifier_seq:
>
> cvar_qualifier:
> CONST_KEYW | VOLATILE_KEYW | ATTRIBUTE_PHRASE
> - | RESTRICT_KEYW
> + | RESTRICT_KEYW | EXTENSION_KEYW
> { /* restrict has no effect in prototypes so ignore it */
> remove_node($1);
> $$ = $1;
Well it's actually technically not a cvar_qualifier; it's a pseudo-
arbitrarily attached keyword that can be stuck on any number of GCC-
only constructs, like nested code: "__extension__ ({ foo(); 1; })"
for example.
Probably the simplest thing to do is actually to just convert it into
a nonexistent or whitespace token, or if there's a preprocessing step
just #define it to the empty string.
Cheers,
Kyle Moffett
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2006-10-07 7:18 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200609150901.33644.ismail@pardus.org.tr>
2006-09-15 6:42 ` __STRICT_ANSI__ checks in headers David Woodhouse
2006-09-15 13:27 ` Kyle Moffett
[not found] ` <200609211200.25214.ismail@pardus.org.tr>
2006-09-21 9:02 ` David Woodhouse
2006-09-21 12:53 ` Ismail Donmez
2006-09-28 7:03 ` Ismail Donmez
2006-09-28 7:06 ` David Woodhouse
2006-09-28 7:30 ` Ismail Donmez
2006-10-01 4:53 ` Andrew Morton
2006-10-01 5:20 ` Kyle Moffett
2006-10-01 7:34 ` Ismail Donmez
2006-10-01 9:14 ` Sam Ravnborg
2006-10-01 12:54 ` Ismail Donmez
2006-10-05 8:16 ` Ismail Donmez
2006-10-05 8:56 ` Kyle Moffett
2006-10-06 8:26 ` David Woodhouse
2006-10-07 7:17 ` Kyle Moffett
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox