mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-07-03 10:01:16 -03:00
Silence unused result warnings on newer compilers
Newer versions of GCC and Clang are not satisfied by a cast to void, this fix is adapted from glibc's solution. New wrapper function ignore_result should be used when a function with explicit _unused_attribute_ wrapper is called whose result will not be handled.
This commit is contained in:
committed by
Kurtis Rader
parent
5356384d0a
commit
e6bb7fc973
@@ -338,7 +338,7 @@ void safe_perror(const char *message) {
|
||||
safe_append(buff, safe_strerror(err), sizeof buff);
|
||||
safe_append(buff, "\n", sizeof buff);
|
||||
|
||||
(void)write(STDERR_FILENO, buff, strlen(buff));
|
||||
ignore_result(write(STDERR_FILENO, buff, strlen(buff)));
|
||||
errno = err;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user