Re: ZeroLink: Perhaps better disabled per default?
Re: ZeroLink: Perhaps better disabled per default?
- Subject: Re: ZeroLink: Perhaps better disabled per default?
- From: Eric Albert <email@hidden>
- Date: Fri, 14 Oct 2005 22:08:34 -0400
On Oct 14, 2005, at 12:53 AM, Marshall Clow wrote:
At 2:41 AM +0200 10/14/05, Andreas Grosam wrote:
While I fully agree with j o a r, I would like to mention, that
this code snippet will compile without errors:
// file: foo.c
extern void bar(); // prototype
void foo() {
boar(); // typo
}
Don't expect errors when compiling with a C compiler. It even will
not complain when the -pedantic or -Wmissing-prototypes flags are on.
This is because it is completely valid and legal code.
Sure, it won't link.
This may be true with gcc, but I have used C compilers (since the
early 1990s) that would complain if they saw a routine that they
had not previously seen a declaration or prototype for. (This
behavior was controlled by a compiler switch, usually called
"Require function prototypes" or something similar.)
gcc will warn about this, saying "warning: implicit declaration of
function 'boar'", if you build with -Wimplicit-function-declaration
(which is set by -Wall). It won't produce an error, but the same
should be true for any other C compiler. However, you can set the -
Werror-implicit-function-declaration flag to make this an error.
-Eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden