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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user