C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

Table 73 MIGRATION_CHECK Warning Messages (continued)
NotesWarnings Displayed
Class/Member Function
NameNo.
5. Equivalent variable not
supported.
5. 'unsigned int offset' is not
supported in Version 3.
1. No equivalent constructor
in Version 3.
1. 'const_iterator (unsigned
int* x, unsigned int y)' is not
supported in version 3.
class const_iterator5
2. No equivalent function in
Version 3.
2. 'void bump_up ()' is not
supported in version 3.
3. No equivalent function in
Version 3.
1. 'void bump_down ()' is
not supported in version 3.
4. Equivalent variable not
supported.
4. 'unsigned int* p' is not
supported in Version 3.
5. Equivalent variable not
supported.
5. 'unsigned int offset' is not
supported in Version 3.
Code Examples
For VERSION3, all classes defined in the C++ Standard are put into namespace std.
For VERSION2,several classes were in global namespace.
VERSION2 code for a simple “Hello world” program:
#include <iostream>
int main (void) {
cout << Hello world << endl;
}
One way to use VERSION3 for the “Hello world” program:
# include <iostream>
int main (void) {
std::cout << Hello world << std::endl;
}
Alternative VERSION3 code for the “Hello world” program:
#include <iostream>
using namespace std:
int main (void) {
cout << Hello world << endl;
}
If you compile the VERSION2 code as VERSION3, you will get two undefined identifiers (cout
and endl). Similar errors occur if you compile the VERSION3 source as VERSION2.
To compile the “Hello world” program (file name test.cpp) using the MIGRATION_CHECK
pragma:
On OSS environment:
c89 test.cpp -Wversion2 -Wmigration_check -Wnosuppress
On Guardian:
nmcplus/ in testcpp, out $s.#list/ ; migration_check, version2
The listing from MIGRATION_CHECK will contain:
5. 1 1 cout << Hello world << endl;
*** Warning: ^
--> (13) : cout is in namespace std:: for version3
456 MIGRATION_CHECK Messages