1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-25 08:12:17 +00:00

osdep: fix clang warnings with _FORTIFY_SOURCE

This fixes warnings generated for `-Wunused-result` when mpv is built
with `-O1 -D_FORTIFY_SOURCE=1` or higher on clang since read/write
functions are declared with the `warn_unused_result` attribute.
Cast to void to avoid these warnings.
This commit is contained in:
llyyr 2023-10-23 19:34:59 +05:30 committed by sfan5
parent 36403e5fd3
commit 06c26e37ed
2 changed files with 2 additions and 2 deletions

View File

@ -134,7 +134,7 @@ static pid_t spawn_process(const char *path, struct mp_subprocess_opts *opts,
as_execvpe(path, opts->exe, opts->args, opts->env ? opts->env : environ);
child_failed:
write(p[1], &(char){1}, 1); // shouldn't be able to fail
(void)write(p[1], &(char){1}, 1); // shouldn't be able to fail
_exit(1);
}

View File

@ -435,7 +435,7 @@ static void *terminal_thread(void *ptr)
}
if (fds[1].revents & POLLIN) {
int8_t c = -1;
read(stop_cont_pipe[0], &c, 1);
(void)read(stop_cont_pipe[0], &c, 1);
if (c == PIPE_STOP)
do_deactivate_getch2();
else if (c == PIPE_CONT)