Undefined functions in C

Ian Wienand ianw@gelato.unsw.edu.au
Mon Feb 7 19:21:00 GMT 2005

On Sun, Feb 06, 2005 at 09:52:50PM -0500, Ian Lance Taylor wrote:
> > Can anyone point me to where C99 explicitly disallows a function
> > without a declaration

> C99 disallows a function without a declaration in paragraph 1:
> "The expression that denotes the called function shall have type
> pointer to function returning void or returning an object type other
> than an array type."  This does not permit an undeclared symbol.

Thanks, that clears it up for me.

> As you note, gcc in c99 mode will always give a warning for an
> undeclared function; this is not true in c89 mode.  In c99 mode, the
> compiler will give an error if you use the -pedantic-errors option.
> Or the -Werror-implicit-function-declaration option.  Or the -Werror
> option.

So do you know why if it is against the standard, gcc in with
--std=c99 requires it be explicitly turned into an error?  Is it just
a backwards/cross compatibility thing?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20050207/5bd94504/attachment.sig>

More information about the Gcc-help mailing list