Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!decwrl!ucbvax!pasteur!ic.Berkeley.EDU!faustus
From: faustus@ic.Berkeley.EDU (Wayne A. Christopher)
Newsgroups: comp.lang.c
Subject: extern question
Message-ID: <4182@pasteur.Berkeley.Edu>
Date: 30 Jun 88 22:43:58 GMT
Sender: news@pasteur.Berkeley.Edu
Lines: 30

Is the following acceptable C code:

	extern int foo();

	bar()
	{
		int (*bla)() = foo;	/* CASE 1 */

		foo();			/* CASE 2 */
	}

	static int
	foo()
	{
		...
	}

In other words, should extern be interpreted as "possible forward
reference" (the way I'm using it), or "externally defined symbol"?  All
the compilers I have used handle case 2 ok, but one couldn't deal with
case 1.  Shouldn't they both work the same?

From an aesthetic viewpoint, I like to use extern anywhere I declare
something but don't define it.  I think writing

	int foo();

for static functions is not as clear.

	Wayne