From 78983cb85e0fa20d559b3bc2c9a05ea751997b9c Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 24 Jan 2025 16:59:00 +0100 Subject: [PATCH] create_test_source_list: declare functions as `extern` This avoids linting thinking that `func_name` can be declared `static`. It is actually in a separate file and found at link time, so explicitly mark it as such. --- Source/cmCreateTestSourceList.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/cmCreateTestSourceList.cxx b/Source/cmCreateTestSourceList.cxx index 11e5f1bd98..5a791f0973 100644 --- a/Source/cmCreateTestSourceList.cxx +++ b/Source/cmCreateTestSourceList.cxx @@ -93,7 +93,8 @@ bool cmCreateTestSourceList(std::vector const& args, tests_func_name.end(); tests_func_name.push_back(func_name); if (!already_declared) { - forwardDeclareCode += cmStrCat("int ", func_name, "(int, char*[]);\n"); + forwardDeclareCode += + cmStrCat("extern int ", func_name, "(int, char*[]);\n"); } }