niklasso / minisat

A minimalistic and high-performance SAT solver
minisat.se
Other
1.02k stars 390 forks source link

Address a g++ compiler error and various warnings #50

Open spakin opened 9 months ago

spakin commented 9 months ago

g++ 11.4.0 rejects the minisat code on the following grounds:

./minisat/core/SolverTypes.h:55:16: error: friend declaration of ‘Minisat::Lit mkLit(Minisat::Var, bool)’ specifies default arguments and isn’t a definition [-fpermissive]
   55 |     friend Lit mkLit(Var var, bool sign = false);
      |                ^~~~~

This revision corrects that problem as well as an unused-variable warning and a bunch of literal-suffix warnings of the form,

./minisat/utils/Options.h:285:29: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
  285 |             fprintf(stderr, "%4"PRIi64, range.begin);
      |                             ^