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]

# 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
# 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