Shut up some warnings

This commit is contained in:
Eelco Dolstra 2017-04-14 14:42:20 +02:00
parent dd3714f6ef
commit f8a2e8a552
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
6 changed files with 17 additions and 13 deletions

View file

@ -7,8 +7,7 @@ dist-files += configure config.h.in nix.spec perl/configure
clean-files += Makefile.config clean-files += Makefile.config
GLOBAL_CXXFLAGS += -I . -I src -I src/libutil -I src/libstore -I src/libmain -I src/libexpr \ GLOBAL_CXXFLAGS += -I . -I src -I src/libutil -I src/libstore -I src/libmain -I src/libexpr
-Wno-unneeded-internal-declaration
$(foreach i, config.h $(call rwildcard, src/lib*, *.hh), \ $(foreach i, config.h $(call rwildcard, src/lib*, *.hh), \
$(eval $(call install-file-in, $(i), $(includedir)/nix, 0644))) $(eval $(call install-file-in, $(i), $(includedir)/nix, 0644)))

View file

@ -37,6 +37,13 @@ namespace {
os.str(emptyStr); os.str(emptyStr);
} }
void do_pad( std::string & s,
std::streamsize w,
const char c,
std::ios::fmtflags f,
bool center)
__attribute__ ((unused));
void do_pad( std::string & s, void do_pad( std::string & s,
std::streamsize w, std::streamsize w,
const char c, const char c,

View file

@ -202,7 +202,7 @@ void initGC()
GC_INIT(); GC_INIT();
GC_oom_fn = oomHandler; GC_set_oom_fn(oomHandler);
/* Set the initial heap size to something fairly big (25% of /* Set the initial heap size to something fairly big (25% of
physical RAM, up to a maximum of 384 MiB) so that in most cases physical RAM, up to a maximum of 384 MiB) so that in most cases

View file

@ -6,8 +6,6 @@ libexpr_DIR := $(d)
libexpr_SOURCES := $(wildcard $(d)/*.cc) $(wildcard $(d)/primops/*.cc) $(d)/lexer-tab.cc $(d)/parser-tab.cc libexpr_SOURCES := $(wildcard $(d)/*.cc) $(wildcard $(d)/primops/*.cc) $(d)/lexer-tab.cc $(d)/parser-tab.cc
libexpr_CXXFLAGS := -Wno-deprecated-register
libexpr_LIBS = libutil libstore libformat libexpr_LIBS = libutil libstore libformat
libexpr_LDFLAGS = libexpr_LDFLAGS =

View file

@ -3376,10 +3376,10 @@ void SubstitutionGoal::tryToRun()
trace("trying to run"); trace("trying to run");
/* Make sure that we are allowed to start a build. Note that even /* Make sure that we are allowed to start a build. Note that even
is maxBuildJobs == 0 (no local builds allowed), we still allow if maxBuildJobs == 0 (no local builds allowed), we still allow
a substituter to run. This is because substitutions cannot be a substituter to run. This is because substitutions cannot be
distributed to another machine via the build hook. */ distributed to another machine via the build hook. */
if (worker.getNrLocalBuilds() >= (settings.maxBuildJobs == 0 ? 1 : settings.maxBuildJobs)) { if (worker.getNrLocalBuilds() >= std::min(1U, (unsigned int) settings.maxBuildJobs)) {
worker.waitForBuildSlot(shared_from_this()); worker.waitForBuildSlot(shared_from_this());
return; return;
} }
@ -3660,7 +3660,7 @@ void Worker::run(const Goals & _topGoals)
if (!children.empty() || !waitingForAWhile.empty()) if (!children.empty() || !waitingForAWhile.empty())
waitForInput(); waitForInput();
else { else {
if (awake.empty() && settings.maxBuildJobs == 0) throw Error( if (awake.empty() && 0 == settings.maxBuildJobs) throw Error(
"unable to start any build; either increase --max-jobs " "unable to start any build; either increase --max-jobs "
"or enable distributed builds"); "or enable distributed builds");
assert(!awake.empty()); assert(!awake.empty());
@ -3697,9 +3697,9 @@ void Worker::waitForInput()
auto nearest = steady_time_point::max(); // nearest deadline auto nearest = steady_time_point::max(); // nearest deadline
for (auto & i : children) { for (auto & i : children) {
if (!i.respectTimeouts) continue; if (!i.respectTimeouts) continue;
if (settings.maxSilentTime != 0) if (0 != settings.maxSilentTime)
nearest = std::min(nearest, i.lastOutput + std::chrono::seconds(settings.maxSilentTime)); nearest = std::min(nearest, i.lastOutput + std::chrono::seconds(settings.maxSilentTime));
if (settings.buildTimeout != 0) if (0 != settings.buildTimeout)
nearest = std::min(nearest, i.timeStarted + std::chrono::seconds(settings.buildTimeout)); nearest = std::min(nearest, i.timeStarted + std::chrono::seconds(settings.buildTimeout));
} }
if (nearest != steady_time_point::max()) { if (nearest != steady_time_point::max()) {
@ -3777,7 +3777,7 @@ void Worker::waitForInput()
} }
if (goal->getExitCode() == Goal::ecBusy && if (goal->getExitCode() == Goal::ecBusy &&
settings.maxSilentTime != 0 && 0 != settings.maxSilentTime &&
j->respectTimeouts && j->respectTimeouts &&
after - j->lastOutput >= std::chrono::seconds(settings.maxSilentTime)) after - j->lastOutput >= std::chrono::seconds(settings.maxSilentTime))
{ {
@ -3788,7 +3788,7 @@ void Worker::waitForInput()
} }
else if (goal->getExitCode() == Goal::ecBusy && else if (goal->getExitCode() == Goal::ecBusy &&
settings.buildTimeout != 0 && 0 != settings.buildTimeout &&
j->respectTimeouts && j->respectTimeouts &&
after - j->timeStarted >= std::chrono::seconds(settings.buildTimeout)) after - j->timeStarted >= std::chrono::seconds(settings.buildTimeout))
{ {

View file

@ -369,7 +369,7 @@ struct CurlDownloader : public Downloader
curl_multi_setopt(curlm, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); curl_multi_setopt(curlm, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX);
#endif #endif
curl_multi_setopt(curlm, CURLMOPT_MAX_TOTAL_CONNECTIONS, curl_multi_setopt(curlm, CURLMOPT_MAX_TOTAL_CONNECTIONS,
settings.binaryCachesParallelConnections); settings.binaryCachesParallelConnections.get());
enableHttp2 = settings.enableHttp2; enableHttp2 = settings.enableHttp2;