From 83e4b63248fb4af97cfc9a0ab452f18bf7a5cfba Mon Sep 17 00:00:00 2001 From: Andrew C Aitchison Date: Sat, 13 Jun 2026 15:39:20 +0100 Subject: [PATCH] strerror is now thread safe --- addons/threadsafety.py | 2 -- test/cli/other_test.py | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/addons/threadsafety.py b/addons/threadsafety.py index 390a245d4e1..25b2c16abe3 100755 --- a/addons/threadsafety.py +++ b/addons/threadsafety.py @@ -91,7 +91,6 @@ 'race:stdin', 'race:stdout', 'race:streams', - 'race:strerror', 'race:strsignal', 'race:strtok', 'race:tmbuf', @@ -261,7 +260,6 @@ 'siginterrupt', 'sleep', 'srand48', - 'strerror', 'strsignal', 'strtok', 'tmpnam', diff --git a/test/cli/other_test.py b/test/cli/other_test.py index 243f600b5a6..71079455b2a 100644 --- a/test/cli/other_test.py +++ b/test/cli/other_test.py @@ -458,9 +458,9 @@ def test_addon_threadsafety(tmpdir): test_file = os.path.join(tmpdir, 'test.cpp') with open(test_file, 'wt') as f: f.write(""" -extern const char* f() +extern void f() { - return strerror(1); + elf_fill(1); } """) @@ -472,7 +472,7 @@ def test_addon_threadsafety(tmpdir): assert lines == [ 'Checking {} ...'.format(test_file) ] - assert stderr == '{}:4:12: warning: strerror is MT-unsafe [threadsafety-unsafe-call]\n'.format(test_file) + assert stderr == '{}:4:5: warning: elf_fill is MT-unsafe [threadsafety-unsafe-call]\n'.format(test_file) def test_addon_naming(tmpdir): @@ -4749,4 +4749,4 @@ def test_ipc_inline_suppressions(tmp_path): stdout_lines = stdout.splitlines() stdout_lines.sort() assert stdout_lines == stdout_exp - assert stderr.splitlines() == [] \ No newline at end of file + assert stderr.splitlines() == []