Undefined functions in C

Ian Wienand ianw@gelato.unsw.edu.au
Tue Feb 8 09:59:00 GMT 2005


On Sun, Feb 06, 2005 at 10:33:03PM -0500, Ian Lance Taylor wrote:
> Given traditional C usage, requiring a function declaration can be
> reasonably viewed as a pedantic requirement, appropriate for
> -pedantic-errors.  In general, if you want gcc to enforce strict
> adherence to the relevant standard, you must use -pedantic-errors.

Thanks, that's good info to know.

> Of course there is a very reasonable coding style in which functions
> should always be declared for use.  For that coding style, there is
> -Werror-implicit-function-declaration.

But in reality, not many people bother setting that.  As a user of a
relatively uncommon 64 bit architecture (at least as a desktop running
a GUI), I've hit many bugs where implicit definitions of functions
that really return pointers chop off the top bits and usually end up
in annoying segfaults somewhere later on.  Maybe as the world moves
from 32 bit desktops it will be more than just me annoyed and the
default will change.

Thanks for your time,

-i
-------------- 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/20050208/386514ba/attachment-0001.sig>


More information about the Gcc-help mailing list