Re: 64bits and a problem with pointers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/12/3 Nicolás Dato wrote:
>
> why? because getpointer() was NOT declared in file1.c, you fix this "issue" by adding
> void *getpointer(void);
> at the beginning of file1.c
>
> why does this happen? because when gcc doesn't find the function getpointer(), I think it
> "declares" it something like this
> int getpointer(...);

Yes, that's how C works.
See http://c-faq.com/decl/implfdecl.html

> and you are NOT warned that you forgot to declare the function (well, it actually tells
> you, if you compile with the -Wall option)

Yes, if you want warnings, use the relevant option to get them.

With new versions of GCC you do get at least one unconditional
warning, which should give you a clue you're doing something wrong:

f.c:3:15: warning: initialization makes pointer from integer without a cast



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux