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:
Richard Barnes 2023-01-11 16:31:31 -08:00 committed by Facebook GitHub Bot
parent 894ce0fd86
commit 567988736d

View file

@ -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);