diff options
-rw-r--r-- | gcc/c-family/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c-family/c-common.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/attr-weak-1.c | 2 |
4 files changed, 13 insertions, 2 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 6685244..f55bc2d 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -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. diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 4af7ef4..2156fa8 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -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))) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6a57865..ec811bc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 diff --git a/gcc/testsuite/gcc.dg/attr-weak-1.c b/gcc/testsuite/gcc.dg/attr-weak-1.c index 014e37d..6504129 100644 --- a/gcc/testsuite/gcc.dg/attr-weak-1.c +++ b/gcc/testsuite/gcc.dg/attr-weak-1.c @@ -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" } */ |