Record Detail

Compile Error

/in/main.cpp: In function 'int main(int, char**)':
/in/main.cpp:36:26: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
         for(int j = 0; j < input.length() - 1; j++){
                        ~~^~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
/in/cnf.cpp: In member function 'void CNF::addClause(Clause)':
/in/cnf.cpp:24:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for(int i = 0; i < cls.getNumLiterals(); i++){
                    ~~^~~~~~~~~~~~~~~~~~~~~~
/in/cnf.cpp: In member function 'void CNF::eliminate(Literal)':
/in/cnf.cpp:32:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for(int i = 0; i < numClauses; i++){
                    ~~^~~~~~~~~~~~
/in/cnf.cpp: In member function 'int CNF::evaluate(const int*) const':
/in/cnf.cpp:41:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for(int i = 0; i < numClauses; i++){
                    ~~^~~~~~~~~~~~
/in/cnf.cpp:51:17: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     if(valueSum == numClauses)//全都是1
        ~~~~~~~~~^~~~~~~~~~~~~
/in/cnf.cpp: In member function 'bool CNF::hasUnit() const':
/in/cnf.cpp:57:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for(int i = 0; i < numClauses; i++){
                    ~~^~~~~~~~~~~~
/in/cnf.cpp: In member function 'Literal CNF::getUnit() const':
/in/cnf.cpp:67:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for(int i = 0; i < numClauses; i++){
                    ~~^~~~~~~~~~~~
/in/cnf.cpp:71:23: error: converting to non-pointer type 'unsigned int' from NULL [-Werror=conversion-null]
     return {NULL, NULL};
                       ^
/in/cnf.cpp: In member function 'CNF CNF::unitPropagate(Literal, int*) const':
/in/cnf.cpp:79:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for(int i = 0; i < numClauses; i++){
                    ~~^~~~~~~~~~~~
/in/cnf.cpp: In member function 'void CNF::print() const':
/in/cnf.cpp:96:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for(int i = 0; i < numClauses; i++){
                    ~~^~~~~~~~~~~~
/in/cnf.cpp:98:14: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
         if(i != numClauses - 1)
            ~~^~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
/in/clause.cpp: In member function 'int Clause::evaluate(const int*) const':
/in/clause.cpp:33:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for(int i = 0; i < numLiterals; i++){
                    ~~^~~~~~~~~~~~~
/in/clause.cpp: In member function 'void Clause::eliminate(Literal)':
/in/clause.cpp:50:13: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     while(i < numLiterals){
           ~~^~~~~~~~~~~~~
/in/clause.cpp:56:34: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
                 for(int j = 0; j < numLiterals; j++){
                                ~~^~~~~~~~~~~~~
/in/clause.cpp:57:52: error: converting to non-pointer type 'unsigned int' from NULL [-Werror=conversion-null]
                     this->literals[j] = {NULL, NULL};
                                                    ^
/in/clause.cpp:67:52: error: converting to non-pointer type 'unsigned int' from NULL [-Werror=conversion-null]
                     this->literals[0] = {NULL, NULL};
                                                    ^
/in/clause.cpp:73:26: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
                     if(i == numLiterals - 1){
                        ~~^~~~~~~~~~~~~~~~~~
/in/clause.cpp:75:50: error: converting to non-pointer type 'unsigned int' from NULL [-Werror=conversion-null]
                         literals[i] = {NULL, NULL};
                                                  ^
/in/clause.cpp:77:38: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
                     for(int j = i; j < numLiterals - 1; j++){
                                    ~~^~~~~~~~~~~~~~~~~
/in/clause.cpp: In member function 'void Clause::print() const':
/in/clause.cpp:102:26: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
         for(int i = 0; i < numLiterals; i++){
                        ~~^~~~~~~~~~~~~
/in/clause.cpp:106:18: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
             if(i != numLiterals -1)
                ~~^~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
/in/solver.cpp: In member function 'virtual void enumerative_solver::solve(const CNF&)':
/in/solver.cpp:20:26: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
         for(int i = 0; i < cnf.getNumVars(); i++){
                        ~~^~~~~~~~~~~~~~~~~~
/in/solver.cpp: In member function 'virtual void deductSolver::solve(const CNF&)':
/in/solver.cpp:96:26: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
         for(int i = 0; i < cnf.getNumVars(); i++){
                        ~~^~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Project Four: SAT
Language
C++
Submit At
2020-11-22 20:02:51
Judged At
2020-11-22 20:02:51
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes