summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-11-03 12:02:05 -0400
committerBrad King <brad.king@kitware.com>2022-11-03 12:02:05 -0400
commit2780c3c683ae3e11807c897dc519a49d8fd2c63f (patch)
tree05d17d4648d25c4638ffbd35319f095482c50fe7
parentc974557598645360fbabac71352b083117e3cc17 (diff)
parent0d3d6870678f9390bdcee6acf19f92f771eefcda (diff)
downloadcmake-2780c3c683ae3e11807c897dc519a49d8fd2c63f.tar.gz
Merge branch 'ci-xcode-14.1' into release-3.24
Merge-request: !7863
-rw-r--r--.gitlab/os-macos.yml12
-rw-r--r--Source/CursesDialog/cmCursesLongMessageForm.cxx2
-rw-r--r--Source/CursesDialog/form/.gitattributes1
-rw-r--r--Source/CursesDialog/form/fty_int.c2
-rw-r--r--Source/CursesDialog/form/fty_num.c2
-rw-r--r--Source/cmFindPackageCommand.cxx8
-rw-r--r--Source/cmStringCommand.cxx3
-rw-r--r--Source/cmSystemTools.cxx2
-rw-r--r--Tests/LoadCommand/CMakeCommands/cmTestCommand.c17
-rw-r--r--Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c17
10 files changed, 37 insertions, 29 deletions
diff --git a/.gitlab/os-macos.yml b/.gitlab/os-macos.yml
index 180384660f..82bcf01e89 100644
--- a/.gitlab/os-macos.yml
+++ b/.gitlab/os-macos.yml
@@ -7,7 +7,7 @@
GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci ext/$CI_CONCURRENT_ID"
# TODO: Factor this out so that each job selects the Xcode version to
# use so that different versions can be tested in a single pipeline.
- DEVELOPER_DIR: "/Applications/Xcode-14.0.app/Contents/Developer"
+ DEVELOPER_DIR: "/Applications/Xcode-14.1.app/Contents/Developer"
# Avoid conflicting with other projects running on the same machine.
SCCACHE_SERVER_PORT: 4227
@@ -95,7 +95,7 @@
- cmake # Since this is a bare runner, pin to a project.
- macos
- shell
- - xcode-14.0
+ - xcode-14.1
- nonconcurrent
.macos_x86_64_builder_tags_package:
@@ -103,7 +103,7 @@
- cmake # Since this is a bare runner, pin to a project.
- macos
- shell
- - xcode-14.0
+ - xcode-14.1
- nonconcurrent
- finder
@@ -112,7 +112,7 @@
- cmake # Since this is a bare runner, pin to a project.
- macos
- shell
- - xcode-14.0
+ - xcode-14.1
- concurrent
.macos_arm64_builder_tags:
@@ -120,7 +120,7 @@
- cmake # Since this is a bare runner, pin to a project.
- macos-arm64
- shell
- - xcode-14.0
+ - xcode-14.1
- nonconcurrent
.macos_arm64_builder_ext_tags:
@@ -128,7 +128,7 @@
- cmake # Since this is a bare runner, pin to a project.
- macos-arm64
- shell
- - xcode-14.0
+ - xcode-14.1
- concurrent
## macOS-specific scripts
diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx
index b14a75175e..6e6f0d662f 100644
--- a/Source/CursesDialog/cmCursesLongMessageForm.cxx
+++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx
@@ -85,7 +85,7 @@ void cmCursesLongMessageForm::UpdateStatusBar()
for (size_t i = 0; i < sideSpace; i++) {
version[i] = ' ';
}
- sprintf(version + sideSpace, "%s", vertmp);
+ snprintf(version + sideSpace, sizeof(version) - sideSpace, "%s", vertmp);
version[width] = '\0';
char fmt_s[] = "%s";
diff --git a/Source/CursesDialog/form/.gitattributes b/Source/CursesDialog/form/.gitattributes
index 12ede74cda..6dfa6277f3 100644
--- a/Source/CursesDialog/form/.gitattributes
+++ b/Source/CursesDialog/form/.gitattributes
@@ -1 +1,2 @@
+* -whitespace
* -format.clang-format-6.0
diff --git a/Source/CursesDialog/form/fty_int.c b/Source/CursesDialog/form/fty_int.c
index 7107fcc3f5..7aeb4b8547 100644
--- a/Source/CursesDialog/form/fty_int.c
+++ b/Source/CursesDialog/form/fty_int.c
@@ -117,7 +117,7 @@ static bool Check_Integer_Field(FIELD * field, const void * argp)
{
if (val<low || val>high) return FALSE;
}
- sprintf(buf,"%.*ld",(prec>0?prec:0),val);
+ snprintf(buf,sizeof(buf),"%.*ld",(prec>0?prec:0),val);
set_field_buffer(field,0,buf);
return TRUE;
}
diff --git a/Source/CursesDialog/form/fty_num.c b/Source/CursesDialog/form/fty_num.c
index 78095995fa..4109b6fb93 100644
--- a/Source/CursesDialog/form/fty_num.c
+++ b/Source/CursesDialog/form/fty_num.c
@@ -140,7 +140,7 @@ static bool Check_Numeric_Field(FIELD * field, const void * argp)
{
if (val<low || val>high) return FALSE;
}
- sprintf(buf,"%.*f",(prec>0?prec:0),val);
+ snprintf(buf,sizeof(buf),"%.*f",(prec>0?prec:0),val);
set_field_buffer(field,0,buf);
return TRUE;
}
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 8c6a0aa334..4ad9124f74 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -822,13 +822,13 @@ void cmFindPackageCommand::SetVersionVariables(
char buf[64];
snprintf(buf, sizeof(buf), "%u", major);
addDefinition(prefix + "_MAJOR", buf);
- sprintf(buf, "%u", minor);
+ snprintf(buf, sizeof(buf), "%u", minor);
addDefinition(prefix + "_MINOR", buf);
- sprintf(buf, "%u", patch);
+ snprintf(buf, sizeof(buf), "%u", patch);
addDefinition(prefix + "_PATCH", buf);
- sprintf(buf, "%u", tweak);
+ snprintf(buf, sizeof(buf), "%u", tweak);
addDefinition(prefix + "_TWEAK", buf);
- sprintf(buf, "%u", count);
+ snprintf(buf, sizeof(buf), "%u", count);
addDefinition(prefix + "_COUNT", buf);
}
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index c3ee6959e4..fe311d117c 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -143,7 +143,8 @@ bool HandleHexCommand(std::vector<std::string> const& args,
std::string::size_type hexIndex = 0;
for (auto const& c : instr) {
- sprintf(&output[hexIndex], "%.2x", static_cast<unsigned char>(c) & 0xFF);
+ snprintf(&output[hexIndex], 3, "%.2x",
+ static_cast<unsigned char>(c) & 0xFF);
hexIndex += 2;
}
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index f077801dae..41fc02a828 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1256,7 +1256,7 @@ std::string cmSystemTools::ComputeCertificateThumbprint(
certContext, CERT_HASH_PROP_ID, hashData, &hashLength)) {
for (DWORD i = 0; i < hashLength; i++) {
// Convert each byte to hexadecimal
- sprintf(pHashPrint, "%02X", hashData[i]);
+ snprintf(pHashPrint, 3, "%02X", hashData[i]);
pHashPrint += 2;
}
*pHashPrint = '\0';
diff --git a/Tests/LoadCommand/CMakeCommands/cmTestCommand.c b/Tests/LoadCommand/CMakeCommands/cmTestCommand.c
index af7b09259a..7176ebe9d4 100644
--- a/Tests/LoadCommand/CMakeCommands/cmTestCommand.c
+++ b/Tests/LoadCommand/CMakeCommands/cmTestCommand.c
@@ -75,10 +75,10 @@ static int CCONV InitialPass(void* inf, void* mf, int argc, char* argv[])
info->CAPI->DisplaySatus(mf, info->CAPI->GetStartOutputDirectory(mf));
info->CAPI->DisplaySatus(mf, info->CAPI->GetCurrentDirectory(mf));
info->CAPI->DisplaySatus(mf, info->CAPI->GetCurrentOutputDirectory(mf));
- sprintf(buffer, "Cache version: %d.%d, CMake version: %d.%d",
- info->CAPI->GetCacheMajorVersion(mf),
- info->CAPI->GetCacheMinorVersion(mf),
- info->CAPI->GetMajorVersion(mf), info->CAPI->GetMinorVersion(mf));
+ snprintf(
+ buffer, sizeof(buffer), "Cache version: %d.%d, CMake version: %d.%d",
+ info->CAPI->GetCacheMajorVersion(mf), info->CAPI->GetCacheMinorVersion(mf),
+ info->CAPI->GetMajorVersion(mf), info->CAPI->GetMinorVersion(mf));
info->CAPI->DisplaySatus(mf, buffer);
if (info->CAPI->CommandExists(mf, "SET")) {
info->CAPI->DisplaySatus(mf, "Command SET exists");
@@ -91,10 +91,12 @@ static int CCONV InitialPass(void* inf, void* mf, int argc, char* argv[])
source_file = info->CAPI->CreateNewSourceFile(mf);
cstr = info->CAPI->SourceFileGetSourceName(source_file);
- sprintf(buffer, "Should be empty (source file name): [%s]", cstr);
+ snprintf(buffer, sizeof(buffer), "Should be empty (source file name): [%s]",
+ cstr);
info->CAPI->DisplaySatus(mf, buffer);
cstr = info->CAPI->SourceFileGetFullPath(source_file);
- sprintf(buffer, "Should be empty (source file full path): [%s]", cstr);
+ snprintf(buffer, sizeof(buffer),
+ "Should be empty (source file full path): [%s]", cstr);
info->CAPI->DisplaySatus(mf, buffer);
info->CAPI->DefineSourceFileProperty(mf, "SOME_PROPERTY", "unused old prop",
"This property is no longer used", 0);
@@ -106,7 +108,8 @@ static int CCONV InitialPass(void* inf, void* mf, int argc, char* argv[])
"This property is for testing.", 0);
info->CAPI->SourceFileSetProperty(source_file, "SOME_PROPERTY2", "HERE");
cstr = info->CAPI->SourceFileGetProperty(source_file, "ABSTRACT");
- sprintf(buffer, "Should be 0 (source file abstract property): [%p]", cstr);
+ snprintf(buffer, sizeof(buffer),
+ "Should be 0 (source file abstract property): [%p]", cstr);
info->CAPI->DisplaySatus(mf, buffer);
info->CAPI->DestroySourceFile(source_file);
diff --git a/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c b/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c
index af7b09259a..7176ebe9d4 100644
--- a/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c
+++ b/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c
@@ -75,10 +75,10 @@ static int CCONV InitialPass(void* inf, void* mf, int argc, char* argv[])
info->CAPI->DisplaySatus(mf, info->CAPI->GetStartOutputDirectory(mf));
info->CAPI->DisplaySatus(mf, info->CAPI->GetCurrentDirectory(mf));
info->CAPI->DisplaySatus(mf, info->CAPI->GetCurrentOutputDirectory(mf));
- sprintf(buffer, "Cache version: %d.%d, CMake version: %d.%d",
- info->CAPI->GetCacheMajorVersion(mf),
- info->CAPI->GetCacheMinorVersion(mf),
- info->CAPI->GetMajorVersion(mf), info->CAPI->GetMinorVersion(mf));
+ snprintf(
+ buffer, sizeof(buffer), "Cache version: %d.%d, CMake version: %d.%d",
+ info->CAPI->GetCacheMajorVersion(mf), info->CAPI->GetCacheMinorVersion(mf),
+ info->CAPI->GetMajorVersion(mf), info->CAPI->GetMinorVersion(mf));
info->CAPI->DisplaySatus(mf, buffer);
if (info->CAPI->CommandExists(mf, "SET")) {
info->CAPI->DisplaySatus(mf, "Command SET exists");
@@ -91,10 +91,12 @@ static int CCONV InitialPass(void* inf, void* mf, int argc, char* argv[])
source_file = info->CAPI->CreateNewSourceFile(mf);
cstr = info->CAPI->SourceFileGetSourceName(source_file);
- sprintf(buffer, "Should be empty (source file name): [%s]", cstr);
+ snprintf(buffer, sizeof(buffer), "Should be empty (source file name): [%s]",
+ cstr);
info->CAPI->DisplaySatus(mf, buffer);
cstr = info->CAPI->SourceFileGetFullPath(source_file);
- sprintf(buffer, "Should be empty (source file full path): [%s]", cstr);
+ snprintf(buffer, sizeof(buffer),
+ "Should be empty (source file full path): [%s]", cstr);
info->CAPI->DisplaySatus(mf, buffer);
info->CAPI->DefineSourceFileProperty(mf, "SOME_PROPERTY", "unused old prop",
"This property is no longer used", 0);
@@ -106,7 +108,8 @@ static int CCONV InitialPass(void* inf, void* mf, int argc, char* argv[])
"This property is for testing.", 0);
info->CAPI->SourceFileSetProperty(source_file, "SOME_PROPERTY2", "HERE");
cstr = info->CAPI->SourceFileGetProperty(source_file, "ABSTRACT");
- sprintf(buffer, "Should be 0 (source file abstract property): [%p]", cstr);
+ snprintf(buffer, sizeof(buffer),
+ "Should be 0 (source file abstract property): [%p]", cstr);
info->CAPI->DisplaySatus(mf, buffer);
info->CAPI->DestroySourceFile(source_file);