toplev.c (compile_file): Don't pedwarn about undefined static functions just because...
authorJason Merrill <jason@yorick.cygnus.com>
Mon, 16 Nov 1998 02:25:57 +0000 (02:25 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 16 Nov 1998 02:25:57 +0000 (21:25 -0500)
* toplev.c (compile_file): Don't pedwarn about undefined static
functions just because we passed -Wunused.

From-SVN: r23672

gcc/ChangeLog
gcc/toplev.c

index 25d7e176dc6614bc868ca1c7bbc7c0e7a5d89e6e..7a5306486ce50b9146e40b817b3d7aa34b575080 100644 (file)
@@ -1,3 +1,8 @@
+Mon Nov 16 02:22:29 1998  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * toplev.c (compile_file): Don't pedwarn about undefined static
+       functions just because we passed -Wunused.
+
 Mon Nov 16 04:41:41 1998  J"orn Rennecke <amylaar@cygnus.co.uk>
 
        * function.c (purge_addressof_1): Unshare rtl created by
@@ -1270,7 +1275,6 @@ Thu Oct 22 15:46:23 1998  Per Bothner (bothner@cygnus.com)
        * Makefile.in (distdir-cvs, distdir-start):  Clean up so it
        works if "$(srcdir)" != ".".
 
->>>>>>> 1.2469
 Wed Oct 21 19:23:59 1998  Jim Wilson  <wilson@cygnus.com>
 
        * expmed.c (store_bit_field): If need to add a SUBREG, then remove
index 2d0cea0f08f974767a95fcaa20e0078edc7f56ef..707da3e09e5c3a27e7c09039bcf8985c6aafe09c 100644 (file)
@@ -2966,8 +2966,12 @@ compile_file (name)
            && ! DECL_ARTIFICIAL (decl)
            && ! TREE_PUBLIC (decl))
          {
-           pedwarn_with_decl (decl, 
-                              "`%s' declared `static' but never defined");
+           if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
+             pedwarn_with_decl (decl,
+                                "`%s' used but never defined");
+           else
+             warning_with_decl (decl,
+                                "`%s' declared `static' but never defined");
            /* This symbol is effectively an "extern" declaration now.  */
            TREE_PUBLIC (decl) = 1;
            assemble_external (decl);