mirror of
https://github.com/facebookexperimental/reverie.git
synced 2025-02-02 09:45:45 +00:00
Remove unused variables in hermetic_infra/reverie/tests/c_tests/forkMany-blockSigchld.c
Summary: LLVM-15 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance. This diff either (a) removes an unused variable and, possibly, it's associated code, or (b) qualifies the variable with `[[maybe_unused]]`, mostly in cases where the variable _is_ used, but, eg, in an `assert` statement that isn't present in production code. - If you approve of this diff, please use the "Accept & Ship" button :-) Reviewed By: luciang Differential Revision: D42465117 fbshipit-source-id: 64e7dec0eecaa4e3c50d4fea5ffd1c57cd8b58d7
This commit is contained in:
parent
894ce0fd86
commit
567988736d
1 changed files with 2 additions and 3 deletions
|
@ -27,7 +27,6 @@ static _Atomic unsigned long* counter;
|
|||
int main(int argc, char* argv[]) {
|
||||
sigset_t oldset, set;
|
||||
pid_t pid;
|
||||
unsigned long c;
|
||||
int status;
|
||||
|
||||
counter = mmap(
|
||||
|
@ -49,10 +48,10 @@ int main(int argc, char* argv[]) {
|
|||
pid = fork();
|
||||
// Child
|
||||
if (pid == 0) {
|
||||
c = atomic_fetch_add(counter, 1);
|
||||
atomic_fetch_add(counter, 1);
|
||||
exit(0);
|
||||
} else if (pid > 0) {
|
||||
c = atomic_fetch_add(counter, 1);
|
||||
atomic_fetch_add(counter, 1);
|
||||
} else {
|
||||
perror("fork: ");
|
||||
exit(1);
|
||||
|
|
Loading…
Reference in a new issue