Skip to content

Commit cdeb1d9

Browse files
Update ignored global variables.
1 parent 5888d48 commit cdeb1d9

File tree

1 file changed

+43
-3
lines changed

1 file changed

+43
-3
lines changed

Tools/c-analyzer/c_globals/supported.py

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,61 @@
2121
'_Py_HashSecret_Initialized': 'process-global',
2222
'_TARGET_LOCALES': 'process-global',
2323

24-
# startup
24+
# startup (only changed before/during)
25+
'_PyRuntime': 'runtime startup',
2526
'runtime_initialized': 'runtime startup',
2627
'static_arg_parsers': 'runtime startup',
2728
'orig_argv': 'runtime startup',
2829
'opt_ptr': 'runtime startup',
2930
'_preinit_warnoptions': 'runtime startup',
3031
'_Py_StandardStreamEncoding': 'runtime startup',
32+
'Py_FileSystemDefaultEncoding': 'runtime startup',
3133
'_Py_StandardStreamErrors': 'runtime startup',
32-
33-
# should be const
34+
'Py_FileSystemDefaultEncodeErrors': 'runtime startup',
35+
'Py_BytesWarningFlag': 'runtime startup',
36+
'Py_DebugFlag': 'runtime startup',
37+
'Py_DontWriteBytecodeFlag': 'runtime startup',
38+
'Py_FrozenFlag': 'runtime startup',
39+
'Py_HashRandomizationFlag': 'runtime startup',
40+
'Py_IgnoreEnvironmentFlag': 'runtime startup',
41+
'Py_InspectFlag': 'runtime startup',
42+
'Py_InteractiveFlag': 'runtime startup',
43+
'Py_IsolatedFlag': 'runtime startup',
44+
'Py_NoSiteFlag': 'runtime startup',
45+
'Py_NoUserSiteDirectory': 'runtime startup',
46+
'Py_OptimizeFlag': 'runtime startup',
47+
'Py_QuietFlag': 'runtime startup',
48+
'Py_UTF8Mode': 'runtime startup',
49+
'Py_UnbufferedStdioFlag': 'runtime startup',
50+
'Py_VerboseFlag': 'runtime startup',
51+
'_Py_path_config': 'runtime startup',
52+
'_PyOS_optarg': 'runtime startup',
53+
'_PyOS_opterr': 'runtime startup',
54+
'_PyOS_optind': 'runtime startup',
55+
'_Py_HashSecret': 'runtime startup',
56+
57+
# effectively const
3458
'tracemalloc_empty_traceback': 'const',
3559
'_empty_bitmap_node': 'const',
3660
'posix_constants_pathconf': 'const',
3761
'posix_constants_confstr': 'const',
3862
'posix_constants_sysconf': 'const',
63+
'_PySys_ImplCacheTag': 'const',
64+
'_PySys_ImplName': 'const',
65+
'PyImport_Inittab': 'const',
66+
'_PyImport_DynLoadFiletab': 'const',
67+
'_PyParser_Grammar': 'const',
68+
'Py_hexdigits': 'const',
69+
'_PyImport_Inittab': 'const',
70+
'_PyByteArray_empty_string': 'const',
71+
'_PyLong_DigitValue': 'const',
72+
'_Py_SwappedOp': 'const',
73+
'PyStructSequence_UnnamedField': 'const',
3974

4075
# signals are main-thread only
4176
'faulthandler_handlers': 'signals are main-thread only',
4277
'user_signals': 'signals are main-thread only',
78+
'wakeup': 'signals are main-thread only',
4379
}
4480

4581
BENIGN = 'races here are benign and unlikely'
@@ -109,6 +145,8 @@ def _is_ignored(variable, ignoredvars=None, *,
109145
return BENIGN
110146
if variable.name == 'ioctl_works':
111147
return BENIGN
148+
if variable.name == '_Py_open_cloexec_works':
149+
return BENIGN
112150
if variable.filename == 'Python/codecs.c':
113151
if variable.name == 'ucnhash_CAPI':
114152
return BENIGN
@@ -150,6 +188,8 @@ def _is_vartype_okay(vartype, ignoredtypes=None):
150188

151189
if vartype.startswith('static const '):
152190
return 'const'
191+
if vartype.startswith('const '):
192+
return 'const'
153193

154194
# components for TypeObject definitions
155195
for name in ('PyMethodDef', 'PyGetSetDef', 'PyMemberDef'):

0 commit comments

Comments
 (0)