Studio 11 compile old code issue#2

Again, under the forte6.2, the old code can be successfully compiled. But under Studio, a new warning is raised:

/vobs/cooperation/thirdparty/lib/APIPublic.hxx", line 337: Warning: declarator required in declaration.

1 Warning(s) detected.

And line 337 is only a typedef declaration:

16#include <APIPublic.h>

337typedef struct APICmdStruct;

And in the APIPublic.h, there is the detailed definition of the APICmdStruct.

Thanks,

icesummit.

[498 byte] By [icesummit] at [2007-11-26 11:27:05]
# 1
I do not know why forte6.2 accepts this expression but 'typedef struct APICmdStruct' actually does not have any sence. In the C++ there is no separate namespace to hold structure names. So you do not have to use 'typedef' to use APICmdStruct without 'struct' keyword.
Atanasyan at 2007-7-7 3:42:43 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2

thanks! I think ithe compiler is using the typedef to make sure the APICmdStruct is declared before using it later.

And in my case, since the header file which contains the struct's definition is already included in the begining, there is no need to add the typedef anymore.

Removing the typedef I can successfully compile without warning.

But why forte6.2 is not complaining anything, that's also I want to know:P

icesummit at 2007-7-7 3:42:43 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3
> But why forte6.2 is not complaining anything, that's> also I want to know:PIt's a bug in FD6u2. It should have complained.
clamage45 at 2007-7-7 3:42:43 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 4
Thanks for help! and what's the bug ID?
icesummit at 2007-7-7 3:42:43 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 5
> thanks! I think ithe compiler is using the typedef to> make sure the APICmdStruct is declared before using> it later.For forward declaration, you should usestruct APICmdStruct;(or "class APICmdStruct;", the two are equivalent)Paul
Paul_Floyd at 2007-7-7 3:42:43 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 6
>> It's a bug in FD6u2. It should have complained. > Thanks for help! and what's the bug ID?There is not necessarily any bug ID. Since FD6u2 is End Of Life, bugs that do not prevent building applications from correct code are not likely to be fixed.
clamage45 at 2007-7-7 3:42:43 > top of Java-index,Development Tools,Solaris and Linux Development Tools...