I am just wondering if this type of declaration is allowed in C++
static nextUnassignedTableID = 0;
static nextUnassignedFieldID = TSFID_MINIMUM_USER_TSFID;
It doesn't complain about anything on Solaris/AIX.
But, on Red Hat Enterprise Linux, it complains about
TSIDConverter.cpp(637): error #303: explicit type is missing ("int" assumed)
static nextUnassignedTableID = 0;
TSIDConverter.cpp(638): error #303: explicit type is missing ("int" assumed)
static nextUnassignedFieldID = TSFID_MINIMUM_USER_TSFID;
On Linux, I am using Intel 11.1 compiler with the command icpc -m32.
Should I include other libs in order for it to compiler, or is this style of declaration not allowed anymore?
It's pretty much never been allowed. The first C++ standard disallowed the C "implicit int" rule; C99 also got rid of that rule. But the rule is simple, and fixing the code is also simple: just stick int in wherever the compiler complains. Tedious, perhaps, but straightforward.
Default int is not allowed in C++, you need to fix this code and set an explicit int type for variables.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With