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
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
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
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
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
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 )
>> {
>> }
>>
>> ---
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