diff options
author | Richard Stallman <rms@gnu.org> | 1993-03-23 22:30:18 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1993-03-23 22:30:18 +0000 |
commit | 7d429c41c5953f4481145c3eb4fe3914d805fd84 (patch) | |
tree | 30527a22916cb99f8ebb3990dea8622c66c28c3b | |
parent | b292ed86c372a999d476c3bc3b9040c24bcb099a (diff) | |
download | gcc-7d429c41c5953f4481145c3eb4fe3914d805fd84.zip gcc-7d429c41c5953f4481145c3eb4fe3914d805fd84.tar.gz gcc-7d429c41c5953f4481145c3eb4fe3914d805fd84.tar.bz2 |
(compile_file): If warning about a function
declared static but not defined, make the function extern.
From-SVN: r3859
-rw-r--r-- | gcc/toplev.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c index 55cb881..d75673c 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. */ |