Date:        Sun, 27 May 2018 18:07:40 +0000 (UTC)
    From:        chris...@astron.com (Christos Zoulas)
    Message-ID:  <pees5c$17s$1...@blaine.gmane.org>

  | It is still useful; consider the following example. You have a file that
  | contains:
  |
  | int foo(void) {     return 1; }
  | int main(void) {    return foo(); }

[I squashed those up to make the mail take less vertical space ...]

  | This will warn; you either want to make foo() static, or you want to
  | have a prototype declaration in scope from a header file which means
  | that the function can be used from outside the file scope.

Typically I want neither of those - I want foo() to be global, so it gets 
entered in the global symtab for nm -g and remains after cc -x
but I am not expecting it to be called from anywhere but this one
location (and certainly not outside this file.)

My typical "solution" is simply to shove

        int foo(void);

immediately before the "int foo(void) {" line,
which silences the warning, but is otherwise just a waste of space.

kre

Reply via email to