Re: GCC 4.5.0 Reports invalid warning

2010-07-15 Thread J Decker
On Thu, Jul 15, 2010 at 6:08 PM, Dave Korn wrote: > On 16/07/2010 01:31, J Decker wrote: >> Oh not so bad then, I can just add at the beginning... >> >> typedef struct a *NeverUsedDefinition; >> >> and now it's happy?  And that makes good coding how? > >  No, that would be bad coding.  Just forwar

Re: GCC 4.5.0 Reports invalid warning

2010-07-15 Thread James Dennett
On Thu, Jul 15, 2010 at 5:31 PM, J Decker wrote: > Oh not so bad then, I can just add at the beginning... > > typedef struct a *NeverUsedDefinition; > > and now it's happy?  And that makes good coding how? If I never > actually use 'NeverUsedDefinition'?  Actually this 'feature' now > causes usele

Re: GCC 4.5.0 Reports invalid warning

2010-07-15 Thread Dave Korn
On 16/07/2010 01:31, J Decker wrote: > Oh not so bad then, I can just add at the beginning... > > typedef struct a *NeverUsedDefinition; > > and now it's happy? And that makes good coding how? No, that would be bad coding. Just forward-declare the tag: struct a; before you try and use it

Re: GCC 4.5.0 Reports invalid warning

2010-07-15 Thread J Decker
Oh not so bad then, I can just add at the beginning... typedef struct a *NeverUsedDefinition; and now it's happy? And that makes good coding how? If I never actually use 'NeverUsedDefinition'? Actually this 'feature' now causes useless and unused declartions to be created. On Thu, Jul 15, 2010

Re: GCC 4.5.0 Reports invalid warning

2010-07-15 Thread Dave Korn
On 16/07/2010 01:21, J Decker wrote: > Now it's happy, why can't it just define 'struct a' as an appropriate > name as it used to, the strucutre still isn't defined. That's just the way that C works, I'm afraid. > (okay every other compiler I mention is MSVC, OpenWatcom, lcc, and gcc > before

Re: GCC 4.5.0 Reports invalid warning

2010-07-15 Thread J Decker
On Thu, Jul 15, 2010 at 5:32 PM, Dave Korn wrote: > On 16/07/2010 00:59, J Decker wrote: > >> -- >> >> #define PointerA struct a * >> >> void f( PointerA ); >> >> typedef struct a * PA; >> struct a { int x; }; >> >> void f( PA a ) >> { >> } >> >> ---

Re: GCC 4.5.0 Reports invalid warning

2010-07-15 Thread Dave Korn
On 16/07/2010 00:59, J Decker wrote: > -- > > #define PointerA struct a * > > void f( PointerA ); > > typedef struct a * PA; > struct a { int x; }; > > void f( PA a ) > { > } > > - > > This is the output > > warning: 'struct a' de