From 7d429c41c5953f4481145c3eb4fe3914d805fd84 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Tue, 23 Mar 1993 22:30:18 +0000 Subject: [PATCH] (compile_file): If warning about a function declared static but not defined, make the function extern. From-SVN: r3859 --- gcc/toplev.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/toplev.c b/gcc/toplev.c index 55cb88185ae..d75673c3630 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1887,7 +1887,14 @@ compile_file (name) && DECL_INITIAL (decl) == 0 && DECL_EXTERNAL (decl) && ! TREE_PUBLIC (decl)) - pedwarn_with_decl (decl, "`%s' declared `static' but never defined"); + { + pedwarn_with_decl (decl, + "`%s' declared `static' but never defined"); + /* This symbol is effectively an "extern" declaration now. */ + TREE_PUBLIC (decl) = 1; + assemble_external (decl); + + } /* Warn about static fns or vars defined but not used, but not about inline functions since unused inline statics is normal practice. */ -- 2.30.2