diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 668524415b99..f55bc2d49cf8 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2011-01-12 Richard Guenther + + 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 * c-common.h (lvalue_error): Update. diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 4af7ef4ee4e7..2156fa8b0d0c 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 6a57865e26d4..ec811bc03808 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-01-12 Richard Guenther + + PR middle-end/32511 + * gcc.dg/attr-weak-1.c: Adjust. + 2011-01-11 Paul Thomas PR fortran/47051 diff --git a/gcc/testsuite/gcc.dg/attr-weak-1.c b/gcc/testsuite/gcc.dg/attr-weak-1.c index 014e37d4d9a5..65041291b844 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" } */