Re: trying to understand: "warning: function declaration isn't a prototype"

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

 



Am Donnerstag, 6. Juli 2006 13:32 schrieb Ingo Krabbe:
>
> You might look at the results of the prototyping you can choose gcc -E
> some_file.c and see the result:
>
> I attached xy.c.  The result of
>
> gcc -E xy.c | grep "typedef.*AbcPtr"             is
> typedef void * AbcPtr;
>
> which seems to be ok.
>
> You should lookup if the definitions above are somehow hidden by
> conditionals, which you also can control via gcc -E.

Ah and I even could reproduce your warning message, but it wasn't that easy 
since gcc -Wall -Wextra -pedantic -ansi xy.c gives no warning.  So I had to 
turn on -Wstrict-prototypes.  The warning vanishes when you write:

TApplContextPtr CreateApplContext (void);
                                   ^^^^   the void here makes the difference



[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