Skip to content

Commit 860ef88

Browse files
committed
Disable warning: ignoring temporary created by a constructor declared with 'nodiscard' attribute
``` frameworks/native/services/surfaceflinger/Scheduler/Scheduler.cpp:492:29: error: ignoring tempora ry created by a constructor declared with 'nodiscard' attribute [-Werror,-Wunused-value] 492 | (std::scoped_lock(mDisplayLock), displayId == mPacesetterDispl ayId)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ frameworks/native/include/ftl/fake_guard.h:85:72: note: expanded from macro 'FTL_FAKE_GUARD' 85 | FTL_MAKE_FAKE_GUARD(__VA_ARGS__, FTL_FAKE_GUARD2, FTL_FAKE_GUARD1, )(__VA_ARGS__) | ^~~~~~~~~~~ frameworks/native/include/ftl/fake_guard.h:80:38: note: expanded from macro 'FTL_FAKE_GUARD2' 80 | (android::ftl::FakeGuard(mutex), expr) | ^~~~ frameworks/native/services/surfaceflinger/Scheduler/Scheduler.cpp:916:27: error: ignoring temporary created by a constructor declared with 'nodiscard' attribute [-Werror,-Wunused-value] ``` Flag: EXEMPT b/369277774 Bug: b/369277774 Change-Id: I6b89de7a127753e435ab70b3ff392e0a84ecc31c
1 parent 521e071 commit 860ef88

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

services/surfaceflinger/Scheduler/Scheduler.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,8 @@ void Scheduler::setDuration(Cycle cycle, std::chrono::nanoseconds workDuration,
486486
}
487487
}
488488

489+
#pragma clang diagnostic push
490+
#pragma clang diagnostic ignored "-Wunused-value" // b/369277774
489491
void Scheduler::updatePhaseConfiguration(PhysicalDisplayId displayId, Fps refreshRate) {
490492
const bool isPacesetter =
491493
FTL_FAKE_GUARD(kMainThreadContext,
@@ -497,6 +499,7 @@ void Scheduler::updatePhaseConfiguration(PhysicalDisplayId displayId, Fps refres
497499
setVsyncConfig(mVsyncModulator->setVsyncConfigSet(mVsyncConfiguration->getCurrentConfigs()),
498500
refreshRate.getPeriod());
499501
}
502+
#pragma clang diagnostic pop
500503

501504
void Scheduler::setActiveDisplayPowerModeForRefreshRateStats(hal::PowerMode powerMode) {
502505
mRefreshRateStats->setPowerMode(powerMode);
@@ -912,6 +915,8 @@ void Scheduler::dumpVsync(std::string& out) const {
912915
}
913916
}
914917

918+
#pragma clang diagnostic push
919+
#pragma clang diagnostic ignored "-Wunused-value" // b/369277774
915920
void Scheduler::updateFrameRateOverrides(GlobalSignals consideredSignals, Fps displayRefreshRate) {
916921
const bool changed = (std::scoped_lock(mPolicyLock),
917922
updateFrameRateOverridesLocked(consideredSignals, displayRefreshRate));
@@ -920,6 +925,7 @@ void Scheduler::updateFrameRateOverrides(GlobalSignals consideredSignals, Fps di
920925
onFrameRateOverridesChanged();
921926
}
922927
}
928+
#pragma clang diagnostic pop
923929

924930
bool Scheduler::updateFrameRateOverridesLocked(GlobalSignals consideredSignals,
925931
Fps displayRefreshRate) {

0 commit comments

Comments
 (0)