Ignore _Py_write_noraise() result: cast to (void) (#108291)

Code using _Py_write_noraise() usually cannot report. Ignore errors
is the least surprising behavior for users.
This commit is contained in:
Victor Stinner
2023-08-22 16:28:20 +02:00
committed by GitHub
parent a541e01537
commit 6541fe4ad7
4 changed files with 9 additions and 9 deletions

View File

@@ -26,7 +26,7 @@
/* Allocate at maximum 100 MiB of the stack to raise the stack overflow */
#define STACK_OVERFLOW_MAX_SIZE (100 * 1024 * 1024)
#define PUTS(fd, str) _Py_write_noraise(fd, str, strlen(str))
#define PUTS(fd, str) (void)_Py_write_noraise(fd, str, strlen(str))
// clang uses __attribute__((no_sanitize("undefined")))
@@ -576,7 +576,7 @@ faulthandler_thread(void *unused)
/* Timeout => dump traceback */
assert(st == PY_LOCK_FAILURE);
_Py_write_noraise(thread.fd, thread.header, (int)thread.header_len);
(void)_Py_write_noraise(thread.fd, thread.header, (int)thread.header_len);
errmsg = _Py_DumpTracebackThreads(thread.fd, thread.interp, NULL);
ok = (errmsg == NULL);