re PR c/32511 (GCC rejects inline+weak function)
authorRichard Guenther <rguenther@suse.de>
Tue, 11 Jan 2011 10:09:15 +0000 (10:09 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 11 Jan 2011 10:09:15 +0000 (10:09 +0000)
2011-01-12  Richard Guenther  <rguenther@suse.de>

PR middle-end/32511
* c-common.c (handle_weak_attribute): Warn instead of error
on declaring an inline function weak.

* gcc.dg/attr-weak-1.c: Adjust.

From-SVN: r168652

gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/attr-weak-1.c

index 668524415b996dca5cde782cf6781a2e68da3499..f55bc2d49cf87d6453560e310357da272e36fc57 100644 (file)
@@ -1,3 +1,9 @@
+2011-01-12  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/32511
+       * c-common.c (handle_weak_attribute): Warn instead of error
+       on declaring an inline function weak.
+
 2011-01-05  Tom Tromey  <tromey@redhat.com>
 
        * c-common.h (lvalue_error): Update.
index 4af7ef4ee4e7cee883146a71fee5d7bacc8c5b87..2156fa8b0d0c4bead8cad1523c487d55766e36c3 100644 (file)
@@ -6656,7 +6656,7 @@ handle_weak_attribute (tree *node, tree name,
   if (TREE_CODE (*node) == FUNCTION_DECL
       && DECL_DECLARED_INLINE_P (*node))
     {
-      error ("inline function %q+D cannot be declared weak", *node);
+      warning (OPT_Wattributes, "inline function %q+D declared weak", *node);
       *no_add_attrs = true;
     }
   else if (lookup_attribute ("ifunc", DECL_ATTRIBUTES (*node)))
index 6a57865e26d42b7a7e614e537f75277e6f7c73a7..ec811bc03808c69728b80b0fb0f56501f272291d 100644 (file)
@@ -1,3 +1,8 @@
+2011-01-12  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/32511
+       * gcc.dg/attr-weak-1.c: Adjust.
+
 2011-01-11  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/47051
index 014e37d4d9a5bbc77e00fdf76315640ead8bf708..65041291b844c79dc0027840439742cad19f1157 100644 (file)
@@ -1,4 +1,4 @@
 /* { dg-do compile } */
 
-__inline void foo(void) __attribute__((weak));  /* { dg-error "inline.*weak" } */
+__inline void foo(void) __attribute__((weak));  /* { dg-warning "inline.*weak" } */