Fix to compile with -Werror=format-security
authorMichael Andres <ma@suse.de>
Tue, 2 Jun 2009 10:36:44 +0000 (12:36 +0200)
committerMichael Andres <ma@suse.de>
Tue, 2 Jun 2009 10:36:44 +0000 (12:36 +0200)
CMakeLists.txt
zypp/parser/HistoryLogReader.cc
zypp/solver/detail/SATResolver.cc

index 2e3c1f0..7a411aa 100644 (file)
@@ -20,8 +20,8 @@ MATH( EXPR LIBZYPP_AGE     "${LIBZYPP_MINOR} - ${LIBZYPP_COMPATMINOR}" )
 MATH( EXPR LIBZYPP_SO_FIRST  "${LIBZYPP_CURRENT}-${LIBZYPP_AGE}" )
 SET( VERSION "${LIBZYPP_MAJOR}.${LIBZYPP_MINOR}.${LIBZYPP_PATCH}" )
 
-SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -g -Wall -Woverloaded-virtual -Wnon-virtual-dtor -Wl,-as-needed" )
-SET( CMAKE_C_FLAGS   "${CMAKE_C_FLAGS}   -fPIC -g -Wall -Wl,-as-needed" )
+SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -g -Wall -Werror=format-security -Woverloaded-virtual -Wnon-virtual-dtor -Wl,-as-needed" )
+SET( CMAKE_C_FLAGS   "${CMAKE_C_FLAGS}   -fPIC -g -Wall -Werror=format-security -Wl,-as-needed" )
 set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3" )
 set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3" )
 
index 511b7d0..53b284f 100644 (file)
@@ -111,7 +111,7 @@ namespace zypp
       ParseException
         e(str::form("Error in history log on line #%u.", lineNr));
       e.addHistory(
-          str::form("Bad number of fields. Got %ld, expected more than %d.",
+          str::form("Bad number of fields. Got %zd, expected more than %d.",
               fields.size(), 2));
       ZYPP_THROW(e);
     }
index e7d3524..3cfd604 100644 (file)
@@ -939,10 +939,10 @@ string SATResolver::SATprobleminfoString(Id problem, string &detail, Id &ignoreI
          ret = str::form (_("problem with installed package %s"), solvable2str(pool, s.get()));
          break;
       case SOLVER_PROBLEM_JOB_RULE:
-         ret = str::form (_("conflicting requests"));
+         ret = _("conflicting requests");
          break;
       case SOLVER_PROBLEM_RPM_RULE:
-         ret = str::form (_("some dependency problem"));
+         ret = _("some dependency problem");
          break;
       case SOLVER_PROBLEM_JOB_NOTHING_PROVIDES_DEP:
          ret = str::form (_("nothing provides requested %s"), dep2str(pool, dep));