1 $DragonFly: src/gnu/usr.bin/cc34/cc_prep/patches/c-decl.c.patch,v 1.1 2004/12/21 13:10:48 joerg Exp $
3 ===================================================================
4 RCS file: /home/joerg/wd/repository/dragonflybsd/src/contrib/gcc-3.4/gcc/c-decl.c,v
5 retrieving revision 1.2
7 --- c-decl.c 20 Dec 2004 19:23:23 -0000 1.2
8 +++ c-decl.c 20 Dec 2004 20:51:28 -0000
13 - /* All decls must agree on a non-default visibility. */
14 - if (DECL_VISIBILITY (newdecl) != VISIBILITY_DEFAULT
15 - && DECL_VISIBILITY (olddecl) != VISIBILITY_DEFAULT
16 + /* All decls must agree on a visibility. */
17 + if (DECL_VISIBILITYSPECIFIED (newdecl) && DECL_VISIBILITYSPECIFIED (olddecl)
18 && DECL_VISIBILITY (newdecl) != DECL_VISIBILITY (olddecl))
20 warning ("%Jredeclaration of '%D' with different visibility "
21 @@ -1366,9 +1365,12 @@
22 Currently, it can only be defined in the prototype. */
23 COPY_DECL_ASSEMBLER_NAME (olddecl, newdecl);
25 - /* If either declaration has a nondefault visibility, use it. */
26 - if (DECL_VISIBILITY (olddecl) != VISIBILITY_DEFAULT)
27 - DECL_VISIBILITY (newdecl) = DECL_VISIBILITY (olddecl);
28 + /* Use visibility of whichever declaration had it specified */
29 + if (DECL_VISIBILITYSPECIFIED (olddecl))
31 + DECL_VISIBILITY (newdecl) = DECL_VISIBILITY (olddecl);
32 + DECL_VISIBILITYSPECIFIED (newdecl) = 1;
35 if (TREE_CODE (newdecl) == FUNCTION_DECL)