From: Richard Stallman Date: Tue, 23 Mar 1993 22:30:18 +0000 (+0000) Subject: (compile_file): If warning about a function X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7d429c41c5953f4481145c3eb4fe3914d805fd84;p=gcc.git (compile_file): If warning about a function declared static but not defined, make the function extern. From-SVN: r3859 --- 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. */