echo ..........................
echo -e '\n\nstandard c++ (-std=c++11)\n------------------------------'
echo g++ && g++-4.8 -std=c++11 -Wall -Wextra -pedantic-errors main.cpp && echo 'g++ ok'
echo -e '\nclang++' && clang++ -std=c++11 -stdlib=libc++ -Wall -Wextra -pedantic-errors main.cpp -lsupc++ && echo 'clang++ ok.'
echo -e '\nlegacy standard c++ (-std=c++98)\n------------------------------'
echo g++ && g++-4.8 -std=c++98 -Wall -Wextra -pedantic-errors main.cpp && echo 'g++ ok'
echo -e '\nclang++' && clang++ -std=c++98 -stdlib=libc++ -Wall -Wextra -pedantic-errors main.cpp -lsupc++ && echo 'clang++ ok.'
echo -e '\nnon-standard (g++/clang++ default)\n------------------------------'
echo g++ && g++-4.8 -Wall -Wextra main.cpp && echo 'g++ ok'
echo -e '\nclang++' && clang++ -stdlib=libc++ -Wall -Wextra main.cpp -lsupc++ && echo 'clang++ ok.'
..........................
standard c++ (-std=c++11)
------------------------------
g++
g++ ok
clang++
clang++ ok.
legacy standard c++ (-std=c++98)
------------------------------
g++
main.cpp: In function ‘int main()’:
main.cpp:86:74: error: extended initializer lists only available with -std=c++11 or -std=gnu++11
employees[0] = {"Susan Meyers", 47899, "Accounting", "Vice President"};
^
main.cpp:86:18: error: extended initializer lists only available with -std=c++11 or -std=gnu++11
employees[0] = {"Susan Meyers", 47899, "Accounting", "Vice President"};
^
main.cpp:87:60: error: extended initializer lists only available with -std=c++11 or -std=gnu++11
employees[1] = {"Mark Jones", 39119, "IT", "Programmer"};
^
main.cpp:87:18: error: extended initializer lists only available with -std=c++11 or -std=gnu++11
employees[1] = {"Mark Jones", 39119, "IT", "Programmer"};
^
main.cpp:88:69: error: extended initializer lists only available with -std=c++11 or -std=gnu++11
employees[2] = {"Joy Rogers", 81774, "Manufacturing", "Engineer"};
^
main.cpp:88:18: error: extended initializer lists only available with -std=c++11 or -std=gnu++11
employees[2] = {"Joy Rogers", 81774, "Manufacturing", "Engineer"};
^
clang++
main.cpp:86:20: error: expected expression
employees[0] = {"Susan Meyers", 47899, "Accounting", "Vice President"};
^
main.cpp:87:20: error: expected expression
employees[1] = {"Mark Jones", 39119, "IT", "Programmer"};
^
main.cpp:88:20: error: expected expression
employees[2] = {"Joy Rogers", 81774, "Manufacturing", "Engineer"};
^
3 errors generated.
non-standard (g++/clang++ default)
------------------------------
g++
main.cpp: In function ‘int main()’:
main.cpp:86:74: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
employees[0] = {"Susan Meyers", 47899, "Accounting", "Vice President"};
^
main.cpp:86:18: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
employees[0] = {"Susan Meyers", 47899, "Accounting", "Vice President"};
^
main.cpp:87:60: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
employees[1] = {"Mark Jones", 39119, "IT", "Programmer"};
^
main.cpp:87:18: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
employees[1] = {"Mark Jones", 39119, "IT", "Programmer"};
^
main.cpp:88:69: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
employees[2] = {"Joy Rogers", 81774, "Manufacturing", "Engineer"};
^
main.cpp:88:18: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
employees[2] = {"Joy Rogers", 81774, "Manufacturing", "Engineer"};
^
g++ ok
clang++
main.cpp:86:20: error: expected expression
employees[0] = {"Susan Meyers", 47899, "Accounting", "Vice President"};
^
main.cpp:87:20: error: expected expression
employees[1] = {"Mark Jones", 39119, "IT", "Programmer"};
^
main.cpp:88:20: error: expected expression
employees[2] = {"Joy Rogers", 81774, "Manufacturing", "Engineer"};
^
3 errors generated. |