mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:18:11 +00:00
Tests: Fix new GCC 12 warnings
This commit is contained in:
parent
cccc001ded
commit
699bd9afc6
3 changed files with 10 additions and 9 deletions
|
@ -139,7 +139,10 @@ int main(int argc, char** argv)
|
|||
return Crash::Failure::UnexpectedError;
|
||||
|
||||
free(uninitialized_memory);
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wuse-after-free"
|
||||
[[maybe_unused]] volatile auto x = uninitialized_memory[4][0];
|
||||
#pragma GCC diagnostic pop
|
||||
return Crash::Failure::DidNotCrash;
|
||||
}).run(run_type);
|
||||
}
|
||||
|
@ -161,8 +164,11 @@ int main(int argc, char** argv)
|
|||
if (!uninitialized_memory)
|
||||
return Crash::Failure::UnexpectedError;
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wuse-after-free"
|
||||
free(uninitialized_memory);
|
||||
uninitialized_memory[4][0] = 1;
|
||||
#pragma GCC diagnostic pop
|
||||
return Crash::Failure::DidNotCrash;
|
||||
}).run(run_type);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue