Skip to contentSkip to conversation

__deprecated requires gcc 3.1

PATCH In review Robert Love 2 participants 3 messages Dec 31, 2002 Sparse checker

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 __deprecated requires gcc 3.1

Linus,

James Bottomley confirmed the "deprecated" attribute requires gcc 3.1 and onward, not gcc 3.0.

Attached patch updates the check in compiler.h to require gcc 3.1 or greater.

Patch is against current BK, please apply.

Robert Love

 include/linux/compiler.h |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
include/linux/compiler.h renamed from include/linux/compiler.h~ +2 -3
diff -urN linux-2.5.53/include/linux/compiler.h linux/include/linux/compiler.h
@@ -17,10 +17,9 @@
  * Allow us to mark functions as 'deprecated' and have gcc emit a nice
  * warning for each use, in hopes of speeding the functions removal.
  * Usage is:
- * 		int deprecated foo(void)
- * and then gcc will emit a warning for each usage of the function.
+ * 		int __deprecated foo(void)
  */
-#if __GNUC__ >= 3
+#if ( __GNUC__ == 3 && __GNUC_MINOR > 0 ) || __GNUC__ > 3
 #define __deprecated	__attribute__((deprecated))
 #else
 #define __deprecated
#1 lore raw

Oops, mea culpa on that one. It's missing a trailing `__' on the end of __GNUC_MINOR

James

===== include/linux/compiler.h 1.8 vs edited =====

include/linux/compiler.h +1 -1
@@ -20,7 +20,7 @@
  * 		int deprecated foo(void)
  * and then gcc will emit a warning for each usage of the function.
  */
-#if __GNUC__ >= 3
+#if ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) || __GNUC__ > 3
 #define __deprecated	__attribute__((deprecated))
 #else
 #define __deprecated
#2 lore raw
Quoted 2 lines · James Bottomley

Oops, mea culpa on that one. It's missing a trailing `__' on the end of __GNUC_MINOR

Looks like Linus already committed it.

Attached patch is against the updated BK and fixes the omission. Sorry.

Robert Love

 include/linux/compiler.h |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
include/linux/compiler.h +1 -1
diff -urN linux-2.5.53/include/linux/compiler.h linux/include/linux/compiler.h
@@ -19,7 +19,7 @@
  * Usage is:
  * 		int __deprecated foo(void)
  */
-#if ( __GNUC__ == 3 && __GNUC_MINOR > 0 ) || __GNUC__ > 3
+#if ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) || __GNUC__ > 3
 #define __deprecated	__attribute__((deprecated))
 #else
 #define __deprecated