Fix unused params and remove unneeded cflags

We already get -Wall and -Werror from the build system, and we do not
want/need -Wexit-time-destructors since it prevents local statics with
non-trivial destructors.

Test: m
Change-Id: I8283bf223404d6c253861d3888c1b720c099386e
This commit is contained in:
T.J. Mercier 2024-03-27 23:40:43 +00:00
parent bc3476d5dc
commit 44eb705480
3 changed files with 7 additions and 14 deletions

View file

@ -5,12 +5,6 @@ package {
cc_defaults {
name: "libprocessgroup_defaults",
cpp_std: "gnu++20",
cflags: [
"-Wall",
"-Werror",
"-Wexit-time-destructors",
"-Wno-unused-parameter",
],
}
cc_library_headers {

View file

@ -82,8 +82,8 @@ class ProfileAction {
virtual void EnableResourceCaching(ResourceCacheType) {}
virtual void DropResourceCaching(ResourceCacheType) {}
virtual bool IsValidForProcess(uid_t uid, pid_t pid) const { return false; }
virtual bool IsValidForTask(pid_t tid) const { return false; }
virtual bool IsValidForProcess(uid_t, pid_t) const { return false; }
virtual bool IsValidForTask(pid_t) const { return false; }
protected:
enum CacheUseResult { SUCCESS, FAIL, UNUSED };
@ -109,8 +109,8 @@ class SetTimerSlackAction : public ProfileAction {
const char* Name() const override { return "SetTimerSlack"; }
bool ExecuteForTask(pid_t tid) const override;
bool IsValidForProcess(uid_t uid, pid_t pid) const override { return true; }
bool IsValidForTask(pid_t tid) const override { return true; }
bool IsValidForProcess(uid_t, pid_t) const override { return true; }
bool IsValidForTask(pid_t) const override { return true; }
private:
unsigned long slack_;

View file

@ -102,8 +102,7 @@ class ProfileAttributeMock : public IProfileAttribute {
public:
ProfileAttributeMock(const std::string& file_name) : file_name_(file_name) {}
~ProfileAttributeMock() override = default;
void Reset(const CgroupController& controller, const std::string& file_name,
const std::string& file_v2_name) override {
void Reset(const CgroupController&, const std::string&, const std::string&) override {
CHECK(false);
}
const CgroupController* controller() const override {
@ -111,10 +110,10 @@ class ProfileAttributeMock : public IProfileAttribute {
return {};
}
const std::string& file_name() const override { return file_name_; }
bool GetPathForProcess(uid_t uid, pid_t pid, std::string* path) const override {
bool GetPathForProcess(uid_t, pid_t pid, std::string* path) const override {
return GetPathForTask(pid, path);
}
bool GetPathForTask(int tid, std::string* path) const override {
bool GetPathForTask(int, std::string* path) const override {
#ifdef __ANDROID__
CHECK(CgroupGetControllerPath(CGROUPV2_HIERARCHY_NAME, path));
CHECK_GT(path->length(), 0);