From 4745934306c57a770e9b9eb9410955cd22031889 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 13 Feb 2024 14:18:19 +1100 Subject: [PATCH] code_clean: update doc-strings to prevent incorrect include removal --- tools/utils_maintenance/code_clean.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/utils_maintenance/code_clean.py b/tools/utils_maintenance/code_clean.py index 17750866e13..bbbd095103e 100755 --- a/tools/utils_maintenance/code_clean.py +++ b/tools/utils_maintenance/code_clean.py @@ -1455,8 +1455,10 @@ class edit_generators: """ Clean headers, ensuring that the headers removed are not used directly or indirectly. - Note that the `CFLAGS` should be set so missing prototypes error instead of warn: - With GCC: `-Werror=missing-prototypes` + Note that the `CFLAGS` should be set so missing prototypes error instead of warn. + With GCC: + CMAKE_C_FLAGS=-Werror=missing-prototypes -Werror=undef + CMAKE_CXX_FLAGS=-Werror=missing-declarations -Werror=undef """ # Non-default because changes to headers may cause breakage on other platforms. @@ -1646,6 +1648,9 @@ def test_edit( if os.path.exists(output): os.remove(output) + # Useful when inspecting failure to compile files, so it's possible to run the command manually. + # `print("COMMAND: {:s}\nCMD: {:s}\nOUTPUT: {:s}\n".format(" ".join(build_args), str(build_cwd), output))` + with open(source, 'w', encoding='utf-8') as fh: fh.write(data_test)