Skip to content

Commit c623a68

Browse files
committed
[libc] Fix warning in ExecuteFunctionUnix.cpp
WIFEXITED and friends expect an `int *` but these methods were marked `const` so they instead got a `const int *`. This macros aren't actually modifying their argument, but we were never using these functions on an immutable `ProcessStatus` type anyway.
1 parent a749e09 commit c623a68

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

libc/utils/testutils/ExecuteFunction.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ struct ProcessStatus {
3535
return failure == reinterpret_cast<const char *>(TIMEOUT);
3636
}
3737
const char *get_error() const { return timed_out() ? nullptr : failure; }
38-
bool exited_normally() const;
39-
int get_exit_code() const;
40-
int get_fatal_signal() const;
38+
bool exited_normally();
39+
int get_exit_code();
40+
int get_fatal_signal();
4141
};
4242

4343
ProcessStatus invoke_in_subprocess(FunctionCaller *func,

libc/utils/testutils/ExecuteFunctionUnix.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,14 @@
2020
namespace __llvm_libc {
2121
namespace testutils {
2222

23-
bool ProcessStatus::exited_normally() const {
24-
return WIFEXITED(platform_defined);
25-
}
23+
bool ProcessStatus::exited_normally() { return WIFEXITED(platform_defined); }
2624

27-
int ProcessStatus::get_exit_code() const {
25+
int ProcessStatus::get_exit_code() {
2826
assert(exited_normally() && "Abnormal termination, no exit code");
2927
return WEXITSTATUS(platform_defined);
3028
}
3129

32-
int ProcessStatus::get_fatal_signal() const {
30+
int ProcessStatus::get_fatal_signal() {
3331
if (exited_normally())
3432
return 0;
3533
return WTERMSIG(platform_defined);

0 commit comments

Comments
 (0)