Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 5 years ago

Language

C++

Compiler

clang HEAD 10.0.0 (https://github.com/llvm-mirror/clang.git 65acf43270ea2894dffa0d0b292b92402f80c8cb) (https://github.com/llvm-mirror/llvm.git 2c4ca6832fa6b306ee6a7010bfb80a3f2596f824)

Options
Warnings
Boost 1.71.0
C++2a(GNU)
no pedantic

Author

anonymous

over 5 years ago

$ clang++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.71.0/clang-head/include -std=gnu++2a
prog.cc:65:30: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
                 polyn.error("Wrong character entered2");
                             ^
prog.cc:100:35: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
                 else polyn.error("Term is missing");  // e.g., 2x - ; or just ';'
                                  ^
prog.cc:102:30: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
                 polyn.error("wrong character entered");
                             ^
prog.cc:98:35: warning: variable 'i' is uninitialized when used here [-Wuninitialized]
                 if (coeffUsed || i > 0)
                                  ^
prog.cc:82:14: note: initialize the variable 'i' to silence this warning
        int i;
             ^
              = 0
prog.cc:124:27: warning: comparison of integers of different signs: 'int' and 'std::__1::vector<Variable, std::__1::allocator<Variable> >::size_type' (aka 'unsigned long') [-Wsign-compare]
            for (i = 1; i <= pol->vars.size(); i++) {
                        ~ ^  ~~~~~~~~~~~~~~~~
prog.cc:144:14: warning: comparison of integers of different signs: 'int' and 'std::__1::vector<Variable, std::__1::allocator<Variable> >::size_type' (aka 'unsigned long') [-Wsign-compare]
    return i == vars.size() && vars.size() == term.vars.size();
           ~ ^  ~~~~~~~~~~~
6 warnings generated.
Enter two polynomials, each ended with a semicolon:
The result is:
 - 8x + 5x3 - 3x4 + 9
Exit Code:
0