This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How To Disable A Specific Warning?


On Sunday 2008-12-28 19:35, Bob Smith wrote:
> ------------foo.c:-------------------
> typedef struct tagFOO
> {
>    int a;
> } FOO;
>
> void FCN (FOO* b)
> {
> }
> ------------foo.pro:-----------------
(should preferably be named foo.h)
> void FCN (struct tagFOO *b);
> ------------fop.c:-------------------
> #include "foo.pro"
> -------------------------------------
> In file included from fop.c:1:
> foo.pro:1: warning: "struct tagFOO" declared inside parameter list
> foo.pro:1: warning: its scope is only this definition or declaration, which is
> probably not what you want
>
> I'm trying to keep the dependency tree down to a minimum, so having to declare
> tagFOO within <fop.c> is counter to that goal.

Well define it in foo.pro:
	struct tagFOO;

Keeping the dependency tree to a minimum is a good idea, but typedefs
will happily interfere with that; http://lkml.org/lkml/2006/11/21/34,
I suggest to just remove them entirely.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]