summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy1
-rw-r--r--Source/CPack/IFW/cmCPackIFWInstaller.cxx2
-rw-r--r--Source/CPack/IFW/cmCPackIFWPackage.cxx2
-rw-r--r--Source/CPack/IFW/cmCPackIFWRepository.cxx2
-rw-r--r--Source/CPack/OSXScriptLauncher.cxx3
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx2
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx2
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackPackageMakerGenerator.cxx6
-rw-r--r--Source/CPack/cmCPackProductBuildGenerator.cxx2
-rw-r--r--Source/CPack/cmCPackRPMGenerator.cxx2
-rw-r--r--Source/CPack/cmCPackSTGZGenerator.cxx2
-rw-r--r--Source/CPack/cpack.cxx2
-rw-r--r--Source/CTest/cmCTestBZR.cxx2
-rw-r--r--Source/CTest/cmCTestBuildAndTestHandler.cxx2
-rw-r--r--Source/CTest/cmCTestBuildCommand.cxx2
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx4
-rw-r--r--Source/CTest/cmCTestConfigureCommand.cxx2
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx4
-rw-r--r--Source/CTest/cmCTestCurl.cxx2
-rw-r--r--Source/CTest/cmCTestGIT.cxx8
-rw-r--r--Source/CTest/cmCTestHandlerCommand.cxx2
-rw-r--r--Source/CTest/cmCTestLaunch.cxx4
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx2
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx4
-rw-r--r--Source/CTest/cmCTestP4.cxx2
-rw-r--r--Source/CTest/cmCTestRunTest.cxx2
-rw-r--r--Source/CTest/cmCTestSVN.cxx4
-rw-r--r--Source/CTest/cmCTestScriptHandler.cxx6
-rw-r--r--Source/CTest/cmCTestSleepCommand.cxx2
-rw-r--r--Source/CTest/cmCTestStartCommand.cxx2
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx4
-rw-r--r--Source/CTest/cmCTestTestCommand.cxx2
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx6
-rw-r--r--Source/CTest/cmCTestVC.cxx4
-rw-r--r--Source/CTest/cmParseBlanketJSCoverage.cxx4
-rw-r--r--Source/CTest/cmParseCacheCoverage.cxx4
-rw-r--r--Source/CTest/cmParseCoberturaCoverage.cxx4
-rw-r--r--Source/CTest/cmParseDelphiCoverage.cxx4
-rw-r--r--Source/CTest/cmParseGTMCoverage.cxx4
-rw-r--r--Source/CTest/cmParseJacocoCoverage.cxx4
-rw-r--r--Source/CTest/cmParsePHPCoverage.cxx4
-rw-r--r--Source/CTest/cmProcess.cxx2
-rw-r--r--Source/CursesDialog/ccmake.cxx4
-rw-r--r--Source/CursesDialog/cmCursesCacheEntryComposite.cxx2
-rw-r--r--Source/CursesDialog/cmCursesLongMessageForm.cxx4
-rw-r--r--Source/CursesDialog/cmCursesMainForm.cxx4
-rw-r--r--Source/CursesDialog/cmCursesMainForm.h2
-rw-r--r--Source/CursesDialog/cmCursesStringWidget.cxx4
-rw-r--r--Source/QtDialog/CMakeSetup.cxx4
-rw-r--r--Source/cmAddSubDirectoryCommand.cxx2
-rw-r--r--Source/cmAffinity.cxx2
-rw-r--r--Source/cmArchiveWrite.cxx4
-rw-r--r--Source/cmArchiveWrite.h2
-rw-r--r--Source/cmAuxSourceDirectoryCommand.cxx2
-rw-r--r--Source/cmBase32.h2
-rw-r--r--Source/cmCMakeHostSystemInformationCommand.cxx2
-rw-r--r--Source/cmCMakeMinimumRequired.cxx2
-rw-r--r--Source/cmCPluginAPI.cxx2
-rw-r--r--Source/cmCTest.cxx10
-rw-r--r--Source/cmCTest.h2
-rw-r--r--Source/cmCacheManager.cxx4
-rw-r--r--Source/cmCommandArgumentParserHelper.cxx2
-rw-r--r--Source/cmComputeComponentGraph.cxx2
-rw-r--r--Source/cmComputeLinkDepends.cxx6
-rw-r--r--Source/cmComputeLinkInformation.cxx4
-rw-r--r--Source/cmComputeTargetDepends.cxx4
-rw-r--r--Source/cmConditionEvaluator.cxx6
-rw-r--r--Source/cmCoreTryCompile.cxx4
-rw-r--r--Source/cmCryptoHash.h2
-rw-r--r--Source/cmCustomCommandGenerator.cxx2
-rw-r--r--Source/cmDefinitions.cxx2
-rw-r--r--Source/cmDependsFortran.cxx4
-rw-r--r--Source/cmDependsJavaParserHelper.cxx6
-rw-r--r--Source/cmDocumentation.cxx4
-rw-r--r--Source/cmDocumentationFormatter.cxx2
-rw-r--r--Source/cmELF.cxx2
-rw-r--r--Source/cmExecProgramCommand.cxx2
-rw-r--r--Source/cmExecuteProcessCommand.cxx4
-rw-r--r--Source/cmExportFileGenerator.cxx4
-rw-r--r--Source/cmExportInstallAndroidMKGenerator.cxx2
-rw-r--r--Source/cmExtraCodeLiteGenerator.cxx2
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx4
-rw-r--r--Source/cmExtraKateGenerator.cxx2
-rw-r--r--Source/cmExtraSublimeTextGenerator.cxx2
-rw-r--r--Source/cmFLTKWrapUICommand.cxx2
-rw-r--r--Source/cmFileCommand.cxx8
-rw-r--r--Source/cmFileCopier.cxx2
-rw-r--r--Source/cmFileLock.cxx2
-rw-r--r--Source/cmFileLockPool.cxx2
-rw-r--r--Source/cmFileLockResult.cxx4
-rw-r--r--Source/cmFileLockUnix.cxx4
-rw-r--r--Source/cmFileMonitor.cxx2
-rw-r--r--Source/cmFilePathChecksum.h2
-rw-r--r--Source/cmFileTime.cxx2
-rw-r--r--Source/cmFindBase.cxx2
-rw-r--r--Source/cmFindCommon.cxx2
-rw-r--r--Source/cmFindLibraryCommand.cxx4
-rw-r--r--Source/cmFindPackageCommand.cxx6
-rw-r--r--Source/cmForEachCommand.cxx4
-rw-r--r--Source/cmFortranParser.h2
-rw-r--r--Source/cmFortranParserImpl.cxx4
-rw-r--r--Source/cmGeneratedFileStream.cxx2
-rw-r--r--Source/cmGeneratorExpression.cxx2
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.cxx2
-rw-r--r--Source/cmGeneratorExpressionEvaluator.h2
-rw-r--r--Source/cmGeneratorExpressionLexer.h2
-rw-r--r--Source/cmGeneratorExpressionNode.cxx8
-rw-r--r--Source/cmGeneratorExpressionParser.cxx4
-rw-r--r--Source/cmGeneratorTarget.cxx10
-rw-r--r--Source/cmGeneratorTarget.h2
-rw-r--r--Source/cmGetPipes.cxx2
-rw-r--r--Source/cmGlobalGenerator.cxx6
-rw-r--r--Source/cmGlobalGhsMultiGenerator.cxx2
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx4
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.h2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx6
-rw-r--r--Source/cmHexFileConverter.cxx6
-rw-r--r--Source/cmInstallCommand.cxx2
-rw-r--r--Source/cmInstallExportGenerator.h2
-rw-r--r--Source/cmInstallTargetGenerator.cxx2
-rw-r--r--Source/cmLinkedTree.h2
-rw-r--r--Source/cmListCommand.cxx6
-rw-r--r--Source/cmListFileCache.cxx2
-rw-r--r--Source/cmListFileCache.h2
-rw-r--r--Source/cmLoadCommandCommand.cxx8
-rw-r--r--Source/cmLocalGenerator.cxx6
-rw-r--r--Source/cmLocalNinjaGenerator.cxx4
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx2
-rw-r--r--Source/cmLocale.h2
-rw-r--r--Source/cmMacroCommand.cxx2
-rw-r--r--Source/cmMakefile.cxx8
-rw-r--r--Source/cmMakefile.h2
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx2
-rw-r--r--Source/cmMakefileTargetGenerator.cxx2
-rw-r--r--Source/cmMathCommand.cxx2
-rw-r--r--Source/cmNewLineStyle.cxx2
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx2
-rw-r--r--Source/cmNinjaTargetGenerator.cxx2
-rw-r--r--Source/cmOrderDirectories.cxx2
-rw-r--r--Source/cmOutputConverter.cxx4
-rw-r--r--Source/cmOutputRequiredFilesCommand.cxx2
-rw-r--r--Source/cmPolicies.cxx8
-rw-r--r--Source/cmProcessOutput.h2
-rw-r--r--Source/cmProcessTools.h2
-rw-r--r--Source/cmRST.cxx4
-rw-r--r--Source/cmRulePlaceholderExpander.cxx4
-rw-r--r--Source/cmSourceFileLocation.cxx2
-rw-r--r--Source/cmSourceGroupCommand.cxx2
-rw-r--r--Source/cmState.cxx6
-rw-r--r--Source/cmStateDirectory.cxx2
-rw-r--r--Source/cmStateSnapshot.cxx2
-rw-r--r--Source/cmStringAlgorithms.cxx4
-rw-r--r--Source/cmStringAlgorithms.h2
-rw-r--r--Source/cmStringCommand.cxx6
-rw-r--r--Source/cmSystemTools.cxx14
-rw-r--r--Source/cmSystemTools.h2
-rw-r--r--Source/cmTarget.cxx4
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx2
-rw-r--r--Source/cmTimestamp.cxx2
-rw-r--r--Source/cmTimestamp.h2
-rw-r--r--Source/cmTryRunCommand.cxx2
-rw-r--r--Source/cmUVHandlePtr.cxx4
-rw-r--r--Source/cmUVProcessChain.cxx2
-rw-r--r--Source/cmUVProcessChain.h3
-rw-r--r--Source/cmUtilitySourceCommand.cxx2
-rw-r--r--Source/cmUuid.cxx2
-rw-r--r--Source/cmWorkerPool.cxx2
-rw-r--r--Source/cmWorkerPool.h2
-rw-r--r--Source/cmXMLParser.cxx4
-rw-r--r--Source/cmXMLSafe.cxx4
-rw-r--r--Source/cm_codecvt.hxx2
-rw-r--r--Source/cm_get_date.h2
-rw-r--r--Source/cmake.cxx4
-rw-r--r--Source/cmakemain.cxx4
-rw-r--r--Source/cmcmd.cxx8
-rw-r--r--Source/ctest.cxx2
-rw-r--r--Tests/CMakeLib/run_compile_commands.cxx2
178 files changed, 289 insertions, 290 deletions
diff --git a/.clang-tidy b/.clang-tidy
index a240e9c..a520679 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -11,7 +11,6 @@ misc-*,\
-misc-static-assert,\
modernize-*,\
-modernize-avoid-c-arrays,\
--modernize-deprecated-headers,\
-modernize-use-nodiscard,\
-modernize-use-noexcept,\
-modernize-use-transparent-functors,\
diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
index b4bfea7..2393279 100644
--- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx
+++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
@@ -13,8 +13,8 @@
#include "cmXMLParser.h"
#include "cmXMLWriter.h"
+#include <cstddef>
#include <sstream>
-#include <stddef.h>
#include <utility>
cmCPackIFWInstaller::cmCPackIFWInstaller() = default;
diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx
index 5fa8cce..9f2a443 100644
--- a/Source/CPack/IFW/cmCPackIFWPackage.cxx
+++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx
@@ -13,9 +13,9 @@
#include "cmTimestamp.h"
#include "cmXMLWriter.h"
+#include <cstddef>
#include <map>
#include <sstream>
-#include <stddef.h>
#include <utility>
//---------------------------------------------------------- CompareStruct ---
diff --git a/Source/CPack/IFW/cmCPackIFWRepository.cxx b/Source/CPack/IFW/cmCPackIFWRepository.cxx
index 8042167..82ddbdb 100644
--- a/Source/CPack/IFW/cmCPackIFWRepository.cxx
+++ b/Source/CPack/IFW/cmCPackIFWRepository.cxx
@@ -8,7 +8,7 @@
#include "cmXMLParser.h"
#include "cmXMLWriter.h"
-#include <stddef.h>
+#include <cstddef>
cmCPackIFWRepository::cmCPackIFWRepository()
: Update(cmCPackIFWRepository::None)
diff --git a/Source/CPack/OSXScriptLauncher.cxx b/Source/CPack/OSXScriptLauncher.cxx
index 00d272c..b8f12fd 100644
--- a/Source/CPack/OSXScriptLauncher.cxx
+++ b/Source/CPack/OSXScriptLauncher.cxx
@@ -3,8 +3,9 @@
#include "cmsys/FStream.hxx"
#include "cmsys/Process.h"
#include "cmsys/SystemTools.hxx"
+
+#include <cstddef>
#include <iostream>
-#include <stddef.h>
#include <string>
#include <vector>
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index cefbc90..0e64b5a 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -13,10 +13,10 @@
#include "cm_sys_stat.h"
#include "cmsys/Glob.hxx"
+#include <cstring>
#include <map>
#include <ostream>
#include <set>
-#include <string.h>
#include <utility>
namespace {
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index ca06b81..bedbfa8 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -12,9 +12,9 @@
#include "cmsys/FStream.hxx"
#include "cmsys/RegularExpression.hxx"
#include <algorithm>
+#include <cstdlib>
#include <iomanip>
#include <map>
-#include <stdlib.h>
#include <CoreFoundation/CoreFoundation.h>
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index 8098edf..3f53186 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -14,10 +14,10 @@
#include "cmsys/Directory.hxx"
#include "cmsys/RegularExpression.hxx"
#include <algorithm>
+#include <cstdlib>
+#include <cstring>
#include <map>
#include <sstream>
-#include <stdlib.h>
-#include <string.h>
#include <utility>
/* NSIS uses different command line syntax on Windows and others */
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx
index 5dc36ab..7be6a7d 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.cxx
+++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx
@@ -4,11 +4,11 @@
#include "cmsys/FStream.hxx"
#include "cmsys/RegularExpression.hxx"
-#include <assert.h>
+#include <cassert>
+#include <cstdio>
+#include <cstdlib>
#include <map>
#include <sstream>
-#include <stdio.h>
-#include <stdlib.h>
#include <string>
#include "cmCPackComponentGroup.h"
diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx
index 800af28..dae268c 100644
--- a/Source/CPack/cmCPackProductBuildGenerator.cxx
+++ b/Source/CPack/cmCPackProductBuildGenerator.cxx
@@ -2,9 +2,9 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCPackProductBuildGenerator.h"
+#include <cstddef>
#include <map>
#include <sstream>
-#include <stddef.h>
#include "cmCPackComponentGroup.h"
#include "cmCPackLog.h"
diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx
index e8728a3..0c1cecf 100644
--- a/Source/CPack/cmCPackRPMGenerator.cxx
+++ b/Source/CPack/cmCPackRPMGenerator.cxx
@@ -3,7 +3,7 @@
#include "cmCPackRPMGenerator.h"
#include <algorithm>
-#include <ctype.h>
+#include <cctype>
#include <map>
#include <ostream>
#include <utility>
diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx
index 3092508..eb48c37 100644
--- a/Source/CPack/cmCPackSTGZGenerator.cxx
+++ b/Source/CPack/cmCPackSTGZGenerator.cxx
@@ -3,8 +3,8 @@
#include "cmCPackSTGZGenerator.h"
#include "cmsys/FStream.hxx"
+#include <cstdio>
#include <sstream>
-#include <stdio.h>
#include <string>
#include <vector>
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 08681ec..ab44a42 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -22,10 +22,10 @@
# include "cmsys/ConsoleBuf.hxx"
#endif
+#include <cstddef>
#include <iostream>
#include <map>
#include <sstream>
-#include <stddef.h>
#include <string>
#include <utility>
#include <vector>
diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx
index 52dc0ac..4ea0c88 100644
--- a/Source/CTest/cmCTestBZR.cxx
+++ b/Source/CTest/cmCTestBZR.cxx
@@ -11,10 +11,10 @@
#include "cm_expat.h"
#include "cmsys/RegularExpression.hxx"
+#include <cstdlib>
#include <list>
#include <map>
#include <ostream>
-#include <stdlib.h>
#include <vector>
extern "C" int cmBZRXMLParserUnknownEncodingHandler(void* /*unused*/,
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index e7fb4c7..0f79670 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.cxx
+++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx
@@ -14,9 +14,9 @@
#include "cmsys/Process.h"
#include <chrono>
+#include <cstdlib>
#include <cstring>
#include <ratio>
-#include <stdlib.h>
cmCTestBuildAndTestHandler::cmCTestBuildAndTestHandler()
{
diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx
index cb22fa6..02b00e3 100644
--- a/Source/CTest/cmCTestBuildCommand.cxx
+++ b/Source/CTest/cmCTestBuildCommand.cxx
@@ -11,8 +11,8 @@
#include "cmSystemTools.h"
#include "cmake.h"
+#include <cstring>
#include <sstream>
-#include <string.h>
class cmExecutionStatus;
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index e07d7aa..86abb12 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -17,9 +17,9 @@
#include "cmsys/Directory.hxx"
#include "cmsys/FStream.hxx"
#include "cmsys/Process.h"
+#include <cstdlib>
+#include <cstring>
#include <set>
-#include <stdlib.h>
-#include <string.h>
#include <utility>
static const char* cmCTestErrorMatches[] = {
diff --git a/Source/CTest/cmCTestConfigureCommand.cxx b/Source/CTest/cmCTestConfigureCommand.cxx
index 320c184..8a56f3d 100644
--- a/Source/CTest/cmCTestConfigureCommand.cxx
+++ b/Source/CTest/cmCTestConfigureCommand.cxx
@@ -10,8 +10,8 @@
#include "cmSystemTools.h"
#include "cmake.h"
+#include <cstring>
#include <sstream>
-#include <string.h>
#include <vector>
cmCTestConfigureCommand::cmCTestConfigureCommand()
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index d9dd931..4d76387 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -24,12 +24,12 @@
#include "cmsys/RegularExpression.hxx"
#include <algorithm>
#include <chrono>
+#include <cstdio>
+#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iterator>
#include <sstream>
-#include <stdio.h>
-#include <stdlib.h>
#include <utility>
class cmMakefile;
diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx
index 40f5918..8793260 100644
--- a/Source/CTest/cmCTestCurl.cxx
+++ b/Source/CTest/cmCTestCurl.cxx
@@ -8,8 +8,8 @@
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
+#include <cstdio>
#include <ostream>
-#include <stdio.h>
cmCTestCurl::cmCTestCurl(cmCTest* ctest)
{
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index 3ae464d..9fd3a62 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -4,10 +4,10 @@
#include "cmsys/FStream.hxx"
#include "cmsys/Process.h"
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
+#include <cctype>
+#include <cstdio>
+#include <cstdlib>
+#include <ctime>
#include <vector>
#include "cmCTest.h"
diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx
index 6add717..9c5425d 100644
--- a/Source/CTest/cmCTestHandlerCommand.cxx
+++ b/Source/CTest/cmCTestHandlerCommand.cxx
@@ -10,9 +10,9 @@
#include "cmSystemTools.h"
#include "cmWorkingDirectory.h"
+#include <cstdlib>
#include <cstring>
#include <sstream>
-#include <stdlib.h>
cmCTestHandlerCommand::cmCTestHandlerCommand()
{
diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx
index ac52581..ba49c29 100644
--- a/Source/CTest/cmCTestLaunch.cxx
+++ b/Source/CTest/cmCTestLaunch.cxx
@@ -5,9 +5,9 @@
#include "cmsys/FStream.hxx"
#include "cmsys/Process.h"
#include "cmsys/RegularExpression.hxx"
+#include <cstdlib>
+#include <cstring>
#include <iostream>
-#include <stdlib.h>
-#include <string.h>
#include "cmCryptoHash.h"
#include "cmGeneratedFileStream.h"
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index 259240f..ba196f0 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -12,9 +12,9 @@
#include "cmsys/Glob.hxx"
#include "cmsys/RegularExpression.hxx"
#include <chrono>
+#include <cstring>
#include <iostream>
#include <sstream>
-#include <string.h>
#include <utility>
struct CatToErrorType
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index af1980a..f79ba2e 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -25,15 +25,15 @@
#include <algorithm>
#include <chrono>
+#include <cmath>
+#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
-#include <math.h>
#include <memory>
#include <sstream>
#include <stack>
-#include <stdlib.h>
#include <unordered_map>
#include <utility>
#include <vector>
diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx
index 08c850d..a6aea85 100644
--- a/Source/CTest/cmCTestP4.cxx
+++ b/Source/CTest/cmCTestP4.cxx
@@ -12,8 +12,8 @@
#include "cmsys/RegularExpression.hxx"
#include <algorithm>
+#include <ctime>
#include <ostream>
-#include <time.h>
#include <utility>
cmCTestP4::cmCTestP4(cmCTest* ct, std::ostream& log)
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index c5bb826..3629a50 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -13,11 +13,11 @@
#include "cmsys/RegularExpression.hxx"
#include <chrono>
#include <cstdint>
+#include <cstdio>
#include <cstring>
#include <iomanip>
#include <ratio>
#include <sstream>
-#include <stdio.h>
#include <utility>
#include "cm_memory.hxx"
diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx
index a945111..6e5b5e7 100644
--- a/Source/CTest/cmCTestSVN.cxx
+++ b/Source/CTest/cmCTestSVN.cxx
@@ -12,10 +12,10 @@
#include "cmXMLWriter.h"
#include "cmsys/RegularExpression.hxx"
+#include <cstdlib>
+#include <cstring>
#include <map>
#include <ostream>
-#include <stdlib.h>
-#include <string.h>
struct cmCTestSVN::Revision : public cmCTestVC::Revision
{
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 81966dd..354e3c4 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -34,13 +34,13 @@
#include "cmSystemTools.h"
#include "cmake.h"
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
#include <map>
#include <memory>
#include <ratio>
#include <sstream>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <utility>
#ifdef _WIN32
diff --git a/Source/CTest/cmCTestSleepCommand.cxx b/Source/CTest/cmCTestSleepCommand.cxx
index 2752cd3..bc4470c 100644
--- a/Source/CTest/cmCTestSleepCommand.cxx
+++ b/Source/CTest/cmCTestSleepCommand.cxx
@@ -4,7 +4,7 @@
#include "cmCTestScriptHandler.h"
-#include <stdlib.h>
+#include <cstdlib>
class cmExecutionStatus;
diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx
index e4a1844..844f2ca 100644
--- a/Source/CTest/cmCTestStartCommand.cxx
+++ b/Source/CTest/cmCTestStartCommand.cxx
@@ -8,8 +8,8 @@
#include "cmMakefile.h"
#include "cmSystemTools.h"
+#include <cstddef>
#include <sstream>
-#include <stddef.h>
class cmExecutionStatus;
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index f215911..ca7fd2c 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -6,9 +6,9 @@
#include "cm_jsoncpp_reader.h"
#include "cm_jsoncpp_value.h"
#include <chrono>
+#include <cstdio>
+#include <cstdlib>
#include <sstream>
-#include <stdio.h>
-#include <stdlib.h>
#include "cmAlgorithms.h"
#include "cmCTest.h"
diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx
index 24de5b4..3a29ad3 100644
--- a/Source/CTest/cmCTestTestCommand.cxx
+++ b/Source/CTest/cmCTestTestCommand.cxx
@@ -10,8 +10,8 @@
#include "cmStringAlgorithms.h"
#include <chrono>
+#include <cstdlib>
#include <sstream>
-#include <stdlib.h>
#include <vector>
cmCTestTestCommand::cmCTestTestCommand()
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index f0c5939..10f9f9b 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -29,15 +29,15 @@
#include <cmsys/Directory.hxx>
#include <cmsys/RegularExpression.hxx>
#include <cstddef>
+#include <cstdio>
+#include <cstdlib>
#include <cstring>
+#include <ctime>
#include <functional>
#include <iomanip>
#include <iterator>
#include <set>
#include <sstream>
-#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
#include <utility>
namespace {
diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx
index 773886d..00919e5 100644
--- a/Source/CTest/cmCTestVC.cxx
+++ b/Source/CTest/cmCTestVC.cxx
@@ -8,9 +8,9 @@
#include "cmXMLWriter.h"
#include "cmsys/Process.h"
+#include <cstdio>
+#include <ctime>
#include <sstream>
-#include <stdio.h>
-#include <time.h>
#include <vector>
cmCTestVC::cmCTestVC(cmCTest* ct, std::ostream& log)
diff --git a/Source/CTest/cmParseBlanketJSCoverage.cxx b/Source/CTest/cmParseBlanketJSCoverage.cxx
index 191100c..8c87700 100644
--- a/Source/CTest/cmParseBlanketJSCoverage.cxx
+++ b/Source/CTest/cmParseBlanketJSCoverage.cxx
@@ -7,8 +7,8 @@
#include "cmSystemTools.h"
#include "cmsys/FStream.hxx"
-#include <stdio.h>
-#include <stdlib.h>
+#include <cstdio>
+#include <cstdlib>
class cmParseBlanketJSCoverage::JSONParser
{
diff --git a/Source/CTest/cmParseCacheCoverage.cxx b/Source/CTest/cmParseCacheCoverage.cxx
index b3ef7d3..da48610 100644
--- a/Source/CTest/cmParseCacheCoverage.cxx
+++ b/Source/CTest/cmParseCacheCoverage.cxx
@@ -7,9 +7,9 @@
#include "cmsys/Directory.hxx"
#include "cmsys/FStream.hxx"
+#include <cstdio>
+#include <cstdlib>
#include <map>
-#include <stdio.h>
-#include <stdlib.h>
#include <utility>
cmParseCacheCoverage::cmParseCacheCoverage(
diff --git a/Source/CTest/cmParseCoberturaCoverage.cxx b/Source/CTest/cmParseCoberturaCoverage.cxx
index e4f353b..7c00d00 100644
--- a/Source/CTest/cmParseCoberturaCoverage.cxx
+++ b/Source/CTest/cmParseCoberturaCoverage.cxx
@@ -7,8 +7,8 @@
#include "cmXMLParser.h"
#include "cmsys/FStream.hxx"
-#include <stdlib.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstring>
class cmParseCoberturaCoverage::XMLParser : public cmXMLParser
{
diff --git a/Source/CTest/cmParseDelphiCoverage.cxx b/Source/CTest/cmParseDelphiCoverage.cxx
index e8a184a..22c756c 100644
--- a/Source/CTest/cmParseDelphiCoverage.cxx
+++ b/Source/CTest/cmParseDelphiCoverage.cxx
@@ -6,8 +6,8 @@
#include "cmsys/FStream.hxx"
#include "cmsys/Glob.hxx"
-#include <stdio.h>
-#include <stdlib.h>
+#include <cstdio>
+#include <cstdlib>
class cmParseDelphiCoverage::HTMLParser
{
diff --git a/Source/CTest/cmParseGTMCoverage.cxx b/Source/CTest/cmParseGTMCoverage.cxx
index 621ca79..1f2181b 100644
--- a/Source/CTest/cmParseGTMCoverage.cxx
+++ b/Source/CTest/cmParseGTMCoverage.cxx
@@ -7,9 +7,9 @@
#include "cmsys/Directory.hxx"
#include "cmsys/FStream.hxx"
+#include <cstdio>
+#include <cstdlib>
#include <map>
-#include <stdio.h>
-#include <stdlib.h>
#include <vector>
cmParseGTMCoverage::cmParseGTMCoverage(cmCTestCoverageHandlerContainer& cont,
diff --git a/Source/CTest/cmParseJacocoCoverage.cxx b/Source/CTest/cmParseJacocoCoverage.cxx
index 6a2d0cc..be6348a 100644
--- a/Source/CTest/cmParseJacocoCoverage.cxx
+++ b/Source/CTest/cmParseJacocoCoverage.cxx
@@ -9,8 +9,8 @@
#include "cmsys/Directory.hxx"
#include "cmsys/FStream.hxx"
#include "cmsys/Glob.hxx"
-#include <stdlib.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstring>
class cmParseJacocoCoverage::XMLParser : public cmXMLParser
{
diff --git a/Source/CTest/cmParsePHPCoverage.cxx b/Source/CTest/cmParsePHPCoverage.cxx
index 870e222..8f0404d 100644
--- a/Source/CTest/cmParsePHPCoverage.cxx
+++ b/Source/CTest/cmParsePHPCoverage.cxx
@@ -7,8 +7,8 @@
#include "cmsys/Directory.hxx"
#include "cmsys/FStream.hxx"
-#include <stdlib.h>
-#include <string.h>
+#include <cstdlib>
+#include <cstring>
/*
To setup coverage for php.
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index 61d2ed3..9c63a59 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/Source/CTest/cmProcess.cxx
@@ -10,8 +10,8 @@
#include "cmStringAlgorithms.h"
#include "cmsys/Process.h"
+#include <csignal>
#include <iostream>
-#include <signal.h>
#include <string>
#if defined(_WIN32)
# include "cm_kwiml.h"
diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx
index ce32898..567b4f4 100644
--- a/Source/CursesDialog/ccmake.cxx
+++ b/Source/CursesDialog/ccmake.cxx
@@ -11,9 +11,9 @@
#include "cmake.h"
#include "cmsys/Encoding.hxx"
+#include <csignal>
+#include <cstring>
#include <iostream>
-#include <signal.h>
-#include <string.h>
#include <string>
#include <vector>
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
index f450a1c..47fe84c 100644
--- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
+++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
@@ -15,7 +15,7 @@
#include "cmSystemTools.h"
#include "cmake.h"
-#include <assert.h>
+#include <cassert>
#include <vector>
cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
diff --git a/Source/CursesDialog/cmCursesLongMessageForm.cxx b/Source/CursesDialog/cmCursesLongMessageForm.cxx
index 95026d5..028cc26 100644
--- a/Source/CursesDialog/cmCursesLongMessageForm.cxx
+++ b/Source/CursesDialog/cmCursesLongMessageForm.cxx
@@ -7,8 +7,8 @@
#include "cmCursesStandardIncludes.h"
#include "cmVersion.h"
-#include <stdio.h>
-#include <string.h>
+#include <cstdio>
+#include <cstring>
inline int ctrl(int z)
{
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index 1b25716..5f8a19e 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -19,8 +19,8 @@
#include "cmake.h"
#include <algorithm>
-#include <stdio.h>
-#include <string.h>
+#include <cstdio>
+#include <cstring>
#include <utility>
inline int ctrl(int z)
diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h
index d379975..f3194ab 100644
--- a/Source/CursesDialog/cmCursesMainForm.h
+++ b/Source/CursesDialog/cmCursesMainForm.h
@@ -9,7 +9,7 @@
#include "cmCursesStandardIncludes.h"
#include "cmStateTypes.h"
-#include <stddef.h>
+#include <cstddef>
#include <string>
#include <vector>
diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx
index 26724e7..3fc1858 100644
--- a/Source/CursesDialog/cmCursesStringWidget.cxx
+++ b/Source/CursesDialog/cmCursesStringWidget.cxx
@@ -8,8 +8,8 @@
#include "cmCursesWidget.h"
#include "cmStateTypes.h"
-#include <stdio.h>
-#include <string.h>
+#include <cstdio>
+#include <cstring>
inline int ctrl(int z)
{
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index 287a482..ad18cfe 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -229,8 +229,8 @@ int main(int argc, char** argv)
#if defined(Q_OS_MAC)
# include "cm_sys_stat.h"
-# include <errno.h>
-# include <string.h>
+# include <cerrno>
+# include <cstring>
# include <unistd.h>
static bool cmOSXInstall(std::string const& dir, std::string const& tool)
{
diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx
index 17bdc4a..c0be308 100644
--- a/Source/cmAddSubDirectoryCommand.cxx
+++ b/Source/cmAddSubDirectoryCommand.cxx
@@ -2,8 +2,8 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmAddSubDirectoryCommand.h"
+#include <cstring>
#include <sstream>
-#include <string.h>
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
diff --git a/Source/cmAffinity.cxx b/Source/cmAffinity.cxx
index a6d89aa..33768a9 100644
--- a/Source/cmAffinity.cxx
+++ b/Source/cmAffinity.cxx
@@ -13,7 +13,7 @@
# include <pthread.h>
# include <sched.h>
// On some platforms CPU_ZERO needs memset but sched.h forgets string.h
-# include <string.h> // IWYU pragma: keep
+# include <cstring> // IWYU pragma: keep
# if defined(__FreeBSD__)
# include <pthread_np.h>
# include <sys/cpuset.h>
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx
index a6c25e1..c45edaf 100644
--- a/Source/cmArchiveWrite.cxx
+++ b/Source/cmArchiveWrite.cxx
@@ -11,10 +11,10 @@
#include "cmsys/Encoding.hxx"
#include "cmsys/FStream.hxx"
+#include <cstring>
+#include <ctime>
#include <iostream>
#include <sstream>
-#include <string.h>
-#include <time.h>
#ifndef __LA_SSIZE_T
# define __LA_SSIZE_T la_ssize_t
diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h
index e90a603..e791761 100644
--- a/Source/cmArchiveWrite.h
+++ b/Source/cmArchiveWrite.h
@@ -5,8 +5,8 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include <cstddef>
#include <iosfwd>
-#include <stddef.h>
#include <string>
#if defined(CMAKE_BOOTSTRAP)
diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx
index 7bf19d0..111bc41 100644
--- a/Source/cmAuxSourceDirectoryCommand.cxx
+++ b/Source/cmAuxSourceDirectoryCommand.cxx
@@ -4,7 +4,7 @@
#include "cmsys/Directory.hxx"
#include <algorithm>
-#include <stddef.h>
+#include <cstddef>
#include <utility>
#include "cmExecutionStatus.h"
diff --git a/Source/cmBase32.h b/Source/cmBase32.h
index c6758d4..d85198d 100644
--- a/Source/cmBase32.h
+++ b/Source/cmBase32.h
@@ -5,7 +5,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
-#include <stddef.h>
+#include <cstddef>
#include <string>
/** \class cmBase32Encoder
diff --git a/Source/cmCMakeHostSystemInformationCommand.cxx b/Source/cmCMakeHostSystemInformationCommand.cxx
index 974b984..c3f6f40 100644
--- a/Source/cmCMakeHostSystemInformationCommand.cxx
+++ b/Source/cmCMakeHostSystemInformationCommand.cxx
@@ -2,7 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCMakeHostSystemInformationCommand.h"
-#include <stddef.h>
+#include <cstddef>
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
diff --git a/Source/cmCMakeMinimumRequired.cxx b/Source/cmCMakeMinimumRequired.cxx
index f93c266..1b03873 100644
--- a/Source/cmCMakeMinimumRequired.cxx
+++ b/Source/cmCMakeMinimumRequired.cxx
@@ -2,8 +2,8 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCMakeMinimumRequired.h"
+#include <cstdio>
#include <sstream>
-#include <stdio.h>
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index f19d99b..9c7beca 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -14,7 +14,7 @@
#include "cmState.h"
#include "cmVersion.h"
-#include <stdlib.h>
+#include <cstdlib>
#ifdef __QNX__
# include <malloc.h> /* for malloc/free on QNX */
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index cd54770..5e17ce8 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -11,16 +11,16 @@
#include "cmsys/Process.h"
#include "cmsys/SystemInformation.hxx"
#include <algorithm>
+#include <cctype>
#include <chrono>
-#include <ctype.h>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
#include <iostream>
#include <map>
#include <sstream>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <string>
-#include <time.h>
#include <utility>
#include <vector>
#if defined(_WIN32)
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index 41dac85..9b11653 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -9,11 +9,11 @@
#include "cmProcessOutput.h"
#include <chrono>
+#include <ctime>
#include <map>
#include <memory>
#include <sstream>
#include <string>
-#include <time.h>
#include <vector>
class cmCTestBuildHandler;
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index e28107f..0888a5e 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -5,9 +5,9 @@
#include "cmsys/FStream.hxx"
#include "cmsys/Glob.hxx"
#include <algorithm>
+#include <cstdio>
+#include <cstring>
#include <sstream>
-#include <stdio.h>
-#include <string.h>
#include <string>
#include "cmGeneratedFileStream.h"
diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx
index b368b3a..e35fba5 100644
--- a/Source/cmCommandArgumentParserHelper.cxx
+++ b/Source/cmCommandArgumentParserHelper.cxx
@@ -8,9 +8,9 @@
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
+#include <cstring>
#include <iostream>
#include <sstream>
-#include <string.h>
int cmCommandArgument_yyparse(yyscan_t yyscanner);
//
diff --git a/Source/cmComputeComponentGraph.cxx b/Source/cmComputeComponentGraph.cxx
index 113463f..655e4ac 100644
--- a/Source/cmComputeComponentGraph.cxx
+++ b/Source/cmComputeComponentGraph.cxx
@@ -4,7 +4,7 @@
#include <algorithm>
-#include <assert.h>
+#include <cassert>
cmComputeComponentGraph::cmComputeComponentGraph(Graph const& input)
: InputGraph(input)
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index 15b0087..2ee4ca2 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -16,11 +16,11 @@
#include "cmake.h"
#include <algorithm>
-#include <assert.h>
+#include <cassert>
+#include <cstdio>
+#include <cstring>
#include <iterator>
#include <sstream>
-#include <stdio.h>
-#include <string.h>
#include <utility>
#include "cm_memory.hxx"
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index ade0f87..09dbbb1 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -20,9 +20,9 @@
#include "cmake.h"
#include <algorithm>
-#include <ctype.h>
+#include <cctype>
+#include <cstring>
#include <sstream>
-#include <string.h>
#include <utility>
//#define CM_COMPUTE_LINK_INFO_DEBUG
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index de82782..239fcdf 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -20,9 +20,9 @@
#include "cmTargetDepend.h"
#include "cmake.h"
-#include <assert.h>
+#include <cassert>
+#include <cstdio>
#include <sstream>
-#include <stdio.h>
#include <utility>
/*
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx
index 97469be..3ddd8ca 100644
--- a/Source/cmConditionEvaluator.cxx
+++ b/Source/cmConditionEvaluator.cxx
@@ -3,11 +3,11 @@
#include "cmConditionEvaluator.h"
#include "cmsys/RegularExpression.hxx"
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
#include <functional>
#include <sstream>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <utility>
#include "cmAlgorithms.h"
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 3687056..12050b3 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -3,10 +3,10 @@
#include "cmCoreTryCompile.h"
#include "cmsys/Directory.hxx"
+#include <cstdio>
+#include <cstring>
#include <set>
#include <sstream>
-#include <stdio.h>
-#include <string.h>
#include <utility>
#include "cmExportTryCompileFileGenerator.h"
diff --git a/Source/cmCryptoHash.h b/Source/cmCryptoHash.h
index 681f5cc..145ff91 100644
--- a/Source/cmCryptoHash.h
+++ b/Source/cmCryptoHash.h
@@ -7,8 +7,8 @@
#include "cm_string_view.hxx"
+#include <cstddef>
#include <memory>
-#include <stddef.h>
#include <string>
#include <vector>
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 6a4125b..2c0cbfd 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -13,8 +13,8 @@
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
+#include <cstddef>
#include <memory>
-#include <stddef.h>
#include <utility>
cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc,
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index e688890..2a117c1 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -4,7 +4,7 @@
#include "cm_string_view.hxx"
-#include <assert.h>
+#include <cassert>
#include <functional>
#include <unordered_set>
#include <utility>
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index b657ff7..de919f1 100644
--- a/Source/cmDependsFortran.cxx
+++ b/Source/cmDependsFortran.cxx
@@ -3,10 +3,10 @@
#include "cmDependsFortran.h"
#include "cmsys/FStream.hxx"
-#include <assert.h>
+#include <cassert>
+#include <cstdlib>
#include <iostream>
#include <map>
-#include <stdlib.h>
#include <utility>
#include "cmFortranParser.h" /* Interface to parser object. */
diff --git a/Source/cmDependsJavaParserHelper.cxx b/Source/cmDependsJavaParserHelper.cxx
index 12d875d..63a96d0 100644
--- a/Source/cmDependsJavaParserHelper.cxx
+++ b/Source/cmDependsJavaParserHelper.cxx
@@ -7,10 +7,10 @@
#include "cm_string_view.hxx"
#include "cmsys/FStream.hxx"
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
#include <iostream>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <utility>
int cmDependsJava_yyparse(yyscan_t yyscanner);
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index d4628fa..d1f3a83 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -11,8 +11,8 @@
#include "cmsys/FStream.hxx"
#include "cmsys/Glob.hxx"
#include <algorithm>
-#include <ctype.h>
-#include <string.h>
+#include <cctype>
+#include <cstring>
#include <utility>
static const char* cmDocumentationStandardOptions[][2] = {
diff --git a/Source/cmDocumentationFormatter.cxx b/Source/cmDocumentationFormatter.cxx
index 3e7f989..be6756a 100644
--- a/Source/cmDocumentationFormatter.cxx
+++ b/Source/cmDocumentationFormatter.cxx
@@ -5,9 +5,9 @@
#include "cmDocumentationEntry.h"
#include "cmDocumentationSection.h"
+#include <cstring>
#include <iomanip>
#include <ostream>
-#include <string.h>
#include <string>
#include <vector>
diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx
index 90250b6..12f996d 100644
--- a/Source/cmELF.cxx
+++ b/Source/cmELF.cxx
@@ -6,10 +6,10 @@
#include "cm_kwiml.h"
#include "cm_memory.hxx"
#include "cmsys/FStream.hxx"
+#include <cstddef>
#include <map>
#include <memory>
#include <sstream>
-#include <stddef.h>
#include <utility>
#include <vector>
diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx
index 74e9c55..207b6fd 100644
--- a/Source/cmExecProgramCommand.cxx
+++ b/Source/cmExecProgramCommand.cxx
@@ -3,7 +3,7 @@
#include "cmExecProgramCommand.h"
#include "cmsys/Process.h"
-#include <stdio.h>
+#include <cstdio>
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx
index acf2a83..12364c8 100644
--- a/Source/cmExecuteProcessCommand.cxx
+++ b/Source/cmExecuteProcessCommand.cxx
@@ -6,10 +6,10 @@
#include "cmsys/Process.h"
#include <algorithm>
-#include <ctype.h> /* isspace */
+#include <cctype> /* isspace */
+#include <cstdio>
#include <iostream>
#include <memory>
-#include <stdio.h>
#include <vector>
#include "cmAlgorithms.h"
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 9545814..e588f7b 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -19,9 +19,9 @@
#include "cmTargetExport.h"
#include "cmsys/FStream.hxx"
-#include <assert.h>
+#include <cassert>
+#include <cstring>
#include <sstream>
-#include <string.h>
#include <utility>
#include "cm_memory.hxx"
diff --git a/Source/cmExportInstallAndroidMKGenerator.cxx b/Source/cmExportInstallAndroidMKGenerator.cxx
index 1b536c9..207ea41 100644
--- a/Source/cmExportInstallAndroidMKGenerator.cxx
+++ b/Source/cmExportInstallAndroidMKGenerator.cxx
@@ -2,8 +2,8 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmExportInstallAndroidMKGenerator.h"
+#include <cstddef>
#include <ostream>
-#include <stddef.h>
#include "cmExportBuildAndroidMKGenerator.h"
#include "cmExportSet.h"
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index 5a01eb2..e74ad0c 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -15,10 +15,10 @@
#include "cmake.h"
#include "cmsys/SystemInformation.hxx"
+#include <cstring>
#include <map>
#include <set>
#include <sstream>
-#include <string.h>
#include <utility>
cmExtraCodeLiteGenerator::cmExtraCodeLiteGenerator()
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index d398018..ca612b5 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -4,10 +4,10 @@
#include "cmsys/RegularExpression.hxx"
#include <algorithm>
-#include <assert.h>
+#include <cassert>
+#include <cstdio>
#include <map>
#include <sstream>
-#include <stdio.h>
#include <utility>
#include "cmGeneratedFileStream.h"
diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx
index 7ac73cf..b3d869e 100644
--- a/Source/cmExtraKateGenerator.cxx
+++ b/Source/cmExtraKateGenerator.cxx
@@ -12,9 +12,9 @@
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
+#include <cstring>
#include <ostream>
#include <set>
-#include <string.h>
#include <vector>
cmExtraKateGenerator::cmExtraKateGenerator() = default;
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index 6ad8609..f041821 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -3,9 +3,9 @@
#include "cmExtraSublimeTextGenerator.h"
#include "cmsys/RegularExpression.hxx"
+#include <cstring>
#include <set>
#include <sstream>
-#include <string.h>
#include <utility>
#include "cmGeneratedFileStream.h"
diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx
index 5094c3c..654714e 100644
--- a/Source/cmFLTKWrapUICommand.cxx
+++ b/Source/cmFLTKWrapUICommand.cxx
@@ -2,7 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmFLTKWrapUICommand.h"
-#include <stddef.h>
+#include <cstddef>
#include "cmCustomCommandLines.h"
#include "cmExecutionStatus.h"
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index e8a7810..33acd05 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -9,14 +9,14 @@
#include "cmsys/RegularExpression.hxx"
#include <algorithm>
-#include <assert.h>
+#include <cassert>
+#include <cctype>
#include <cmath>
-#include <ctype.h>
+#include <cstdio>
+#include <cstdlib>
#include <map>
#include <set>
#include <sstream>
-#include <stdio.h>
-#include <stdlib.h>
#include <utility>
#include <vector>
diff --git a/Source/cmFileCopier.cxx b/Source/cmFileCopier.cxx
index e00e726..5b9c85a 100644
--- a/Source/cmFileCopier.cxx
+++ b/Source/cmFileCopier.cxx
@@ -16,8 +16,8 @@
# include "cmsys/FStream.hxx"
#endif
+#include <cstring>
#include <sstream>
-#include <string.h>
using namespace cmFSPermissions;
diff --git a/Source/cmFileLock.cxx b/Source/cmFileLock.cxx
index 1e472da..d380798 100644
--- a/Source/cmFileLock.cxx
+++ b/Source/cmFileLock.cxx
@@ -3,7 +3,7 @@
#include "cmFileLock.h"
#include "cmFileLockResult.h"
-#include <assert.h>
+#include <cassert>
// Common implementation
diff --git a/Source/cmFileLockPool.cxx b/Source/cmFileLockPool.cxx
index d700a79..8db2db2 100644
--- a/Source/cmFileLockPool.cxx
+++ b/Source/cmFileLockPool.cxx
@@ -2,7 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmFileLockPool.h"
-#include <assert.h>
+#include <cassert>
#include "cmAlgorithms.h"
#include "cmFileLock.h"
diff --git a/Source/cmFileLockResult.cxx b/Source/cmFileLockResult.cxx
index c4779f0..9d5a6c6 100644
--- a/Source/cmFileLockResult.cxx
+++ b/Source/cmFileLockResult.cxx
@@ -2,8 +2,8 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmFileLockResult.h"
-#include <errno.h>
-#include <string.h>
+#include <cerrno>
+#include <cstring>
#define WINMSG_BUF_LEN (1024)
cmFileLockResult cmFileLockResult::MakeOk()
diff --git a/Source/cmFileLockUnix.cxx b/Source/cmFileLockUnix.cxx
index 1bf5013..7393823 100644
--- a/Source/cmFileLockUnix.cxx
+++ b/Source/cmFileLockUnix.cxx
@@ -3,9 +3,9 @@
#include "cmFileLock.h"
#include "cmSystemTools.h"
-#include <errno.h> // errno
+#include <cerrno> // errno
+#include <cstdio> // SEEK_SET
#include <fcntl.h>
-#include <stdio.h> // SEEK_SET
#include <unistd.h>
cmFileLock::cmFileLock() = default;
diff --git a/Source/cmFileMonitor.cxx b/Source/cmFileMonitor.cxx
index 56ee739..7fcced2 100644
--- a/Source/cmFileMonitor.cxx
+++ b/Source/cmFileMonitor.cxx
@@ -6,7 +6,7 @@
#include "cmsys/SystemTools.hxx"
#include <cassert>
-#include <stddef.h>
+#include <cstddef>
#include <unordered_map>
#include <utility>
diff --git a/Source/cmFilePathChecksum.h b/Source/cmFilePathChecksum.h
index 30881ce..b7d5cd2 100644
--- a/Source/cmFilePathChecksum.h
+++ b/Source/cmFilePathChecksum.h
@@ -6,7 +6,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <array>
-#include <stddef.h>
+#include <cstddef>
#include <string>
#include <utility>
diff --git a/Source/cmFileTime.cxx b/Source/cmFileTime.cxx
index 253457f..f92c0ff 100644
--- a/Source/cmFileTime.cxx
+++ b/Source/cmFileTime.cxx
@@ -2,8 +2,8 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmFileTime.h"
+#include <ctime>
#include <string>
-#include <time.h>
// Use a platform-specific API to get file times efficiently.
#if !defined(_WIN32) || defined(__CYGWIN__)
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index e0daa4f..7d74118 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -2,10 +2,10 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmFindBase.h"
+#include <cstddef>
#include <deque>
#include <iostream>
#include <map>
-#include <stddef.h>
#include "cmAlgorithms.h"
#include "cmMakefile.h"
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index 5606838..badec55 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -4,7 +4,7 @@
#include <algorithm>
#include <array>
-#include <string.h>
+#include <cstring>
#include <utility>
#include "cmAlgorithms.h"
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index 529e5c8..011e8aa 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/Source/cmFindLibraryCommand.cxx
@@ -4,9 +4,9 @@
#include "cmsys/RegularExpression.hxx"
#include <algorithm>
+#include <cstdio>
+#include <cstring>
#include <set>
-#include <stdio.h>
-#include <string.h>
#include <utility>
#include "cmGlobalGenerator.h"
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 8f76030..8c8cf13 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -9,13 +9,13 @@
#include "cmsys/RegularExpression.hxx"
#include "cmsys/String.h"
#include <algorithm>
-#include <assert.h>
+#include <cassert>
+#include <cstdio>
+#include <cstring>
#include <deque>
#include <functional>
#include <iterator>
#include <sstream>
-#include <stdio.h>
-#include <string.h>
#include <utility>
#include "cm_memory.hxx"
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx
index f0633aa..3c39c46 100644
--- a/Source/cmForEachCommand.cxx
+++ b/Source/cmForEachCommand.cxx
@@ -2,9 +2,9 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmForEachCommand.h"
+#include <cstdio>
+#include <cstdlib>
#include <sstream>
-#include <stdio.h>
-#include <stdlib.h>
#include <utility>
#include "cm_memory.hxx"
diff --git a/Source/cmFortranParser.h b/Source/cmFortranParser.h
index 825876c..6f97b42 100644
--- a/Source/cmFortranParser.h
+++ b/Source/cmFortranParser.h
@@ -12,7 +12,7 @@
# include <vector>
#endif
-#include <stddef.h> /* size_t */
+#include <cstddef> /* size_t */
/* Forward declare parser object type. */
using cmFortranParser = struct cmFortranParser_s;
diff --git a/Source/cmFortranParserImpl.cxx b/Source/cmFortranParserImpl.cxx
index ad377de..b983b4d 100644
--- a/Source/cmFortranParserImpl.cxx
+++ b/Source/cmFortranParserImpl.cxx
@@ -5,10 +5,10 @@
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
-#include <assert.h>
+#include <cassert>
+#include <cstdio>
#include <set>
#include <stack>
-#include <stdio.h>
#include <string>
#include <utility>
#include <vector>
diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx
index 491d96f..2af04b6 100644
--- a/Source/cmGeneratedFileStream.cxx
+++ b/Source/cmGeneratedFileStream.cxx
@@ -2,7 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmGeneratedFileStream.h"
-#include <stdio.h>
+#include <cstdio>
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 7bb6a63..f49ed2c 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -6,7 +6,6 @@
#include <memory>
#include <utility>
-#include "assert.h"
#include "cmAlgorithms.h"
#include "cmGeneratorExpressionContext.h"
#include "cmGeneratorExpressionDAGChecker.h"
@@ -15,6 +14,7 @@
#include "cmGeneratorExpressionParser.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
+#include <cassert>
cmGeneratorExpression::cmGeneratorExpression(cmListFileBacktrace backtrace)
: Backtrace(std::move(backtrace))
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index dda0abc..76f2905 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -10,8 +10,8 @@
#include "cmStringAlgorithms.h"
#include "cmake.h"
+#include <cstring>
#include <sstream>
-#include <string.h>
#include <utility>
cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
diff --git a/Source/cmGeneratorExpressionEvaluator.h b/Source/cmGeneratorExpressionEvaluator.h
index 4530152..b10bb5b 100644
--- a/Source/cmGeneratorExpressionEvaluator.h
+++ b/Source/cmGeneratorExpressionEvaluator.h
@@ -5,7 +5,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
-#include <stddef.h>
+#include <cstddef>
#include <string>
#include <utility>
#include <vector>
diff --git a/Source/cmGeneratorExpressionLexer.h b/Source/cmGeneratorExpressionLexer.h
index bf24308..9e01948 100644
--- a/Source/cmGeneratorExpressionLexer.h
+++ b/Source/cmGeneratorExpressionLexer.h
@@ -5,7 +5,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
-#include <stddef.h>
+#include <cstddef>
#include <string>
#include <vector>
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 89b6c1c..6cb7a96 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -30,15 +30,15 @@
#include "cmsys/String.h"
#include <algorithm>
-#include <assert.h>
-#include <errno.h>
+#include <cassert>
+#include <cerrno>
+#include <cstdlib>
+#include <cstring>
#include <iterator>
#include <map>
#include <memory>
#include <set>
#include <sstream>
-#include <stdlib.h>
-#include <string.h>
#include <utility>
std::string cmGeneratorExpressionNode::EvaluateDependentExpression(
diff --git a/Source/cmGeneratorExpressionParser.cxx b/Source/cmGeneratorExpressionParser.cxx
index ba00b94..a0b685e 100644
--- a/Source/cmGeneratorExpressionParser.cxx
+++ b/Source/cmGeneratorExpressionParser.cxx
@@ -5,8 +5,8 @@
#include "cmAlgorithms.h"
#include "cmGeneratorExpressionEvaluator.h"
-#include <assert.h>
-#include <stddef.h>
+#include <cassert>
+#include <cstddef>
#include <utility>
cmGeneratorExpressionParser::cmGeneratorExpressionParser(
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index b019e0b..2ca5706 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -4,16 +4,16 @@
#include "cmsys/RegularExpression.hxx"
#include <algorithm>
-#include <assert.h>
+#include <cassert>
+#include <cerrno>
#include <cstddef>
-#include <errno.h>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
#include <iterator>
#include <memory>
#include <queue>
#include <sstream>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <unordered_set>
#include <utility>
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 9eb2ecf..4207d65 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -10,9 +10,9 @@
#include "cmPolicies.h"
#include "cmStateTypes.h"
+#include <cstddef>
#include <map>
#include <set>
-#include <stddef.h>
#include <string>
#include <unordered_map>
#include <utility>
diff --git a/Source/cmGetPipes.cxx b/Source/cmGetPipes.cxx
index ad323f7..79f90fd 100644
--- a/Source/cmGetPipes.cxx
+++ b/Source/cmGetPipes.cxx
@@ -28,7 +28,7 @@ int cmGetPipes(int* fds)
return 0;
}
#else
-# include <errno.h>
+# include <cerrno>
# include <unistd.h>
int cmGetPipes(int* fds)
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 9479424..2273c50 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -5,13 +5,13 @@
#include "cmsys/Directory.hxx"
#include "cmsys/FStream.hxx"
#include <algorithm>
-#include <assert.h>
+#include <cassert>
+#include <cstdio>
+#include <cstdlib>
#include <cstring>
#include <initializer_list>
#include <iterator>
#include <sstream>
-#include <stdio.h>
-#include <stdlib.h>
#if defined(_WIN32) && !defined(__CYGWIN__)
# include <windows.h>
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 0b45f4b..236554f 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -18,9 +18,9 @@
#include "cmake.h"
#include <algorithm>
+#include <cstring>
#include <map>
#include <ostream>
-#include <string.h>
#include <utility>
const char* cmGlobalGhsMultiGenerator::FILE_EXTENSION = ".gpj";
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 062eccb..9ce6324 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -7,10 +7,10 @@
#include "cm_jsoncpp_writer.h"
#include "cmsys/FStream.hxx"
#include <algorithm>
-#include <ctype.h>
+#include <cctype>
+#include <cstdio>
#include <iterator>
#include <sstream>
-#include <stdio.h>
#include "cm_memory.hxx"
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index 264de54..6a39509 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -5,10 +5,10 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include <cstddef>
#include <iosfwd>
#include <map>
#include <set>
-#include <stddef.h>
#include <string>
#include <vector>
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index af5d279..de04e84 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -3,11 +3,11 @@
#include "cmGlobalXCodeGenerator.h"
#include "cmsys/RegularExpression.hxx"
-#include <assert.h>
+#include <cassert>
+#include <cstdio>
+#include <cstring>
#include <iomanip>
#include <sstream>
-#include <stdio.h>
-#include <string.h>
#include "cm_memory.hxx"
diff --git a/Source/cmHexFileConverter.cxx b/Source/cmHexFileConverter.cxx
index 190f2e3..2fa4b55 100644
--- a/Source/cmHexFileConverter.cxx
+++ b/Source/cmHexFileConverter.cxx
@@ -2,9 +2,9 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmHexFileConverter.h"
-#include <ctype.h>
-#include <stdio.h>
-#include <string.h>
+#include <cctype>
+#include <cstdio>
+#include <cstring>
#include "cmSystemTools.h"
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 9a78c49..9b931f7 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -4,9 +4,9 @@
#include "cm_static_string_view.hxx"
#include "cmsys/Glob.hxx"
+#include <cstddef>
#include <set>
#include <sstream>
-#include <stddef.h>
#include <utility>
#include "cmArgumentParser.h"
diff --git a/Source/cmInstallExportGenerator.h b/Source/cmInstallExportGenerator.h
index e680066..3b9268a 100644
--- a/Source/cmInstallExportGenerator.h
+++ b/Source/cmInstallExportGenerator.h
@@ -8,8 +8,8 @@
#include "cmInstallGenerator.h"
#include "cmScriptGenerator.h"
+#include <cstddef>
#include <iosfwd>
-#include <stddef.h>
#include <string>
#include <vector>
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 7bbef35..90b0e1d 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -2,7 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmInstallTargetGenerator.h"
-#include <assert.h>
+#include <cassert>
#include <map>
#include <memory>
#include <set>
diff --git a/Source/cmLinkedTree.h b/Source/cmLinkedTree.h
index 8b91162..c7453ea 100644
--- a/Source/cmLinkedTree.h
+++ b/Source/cmLinkedTree.h
@@ -5,7 +5,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
-#include <assert.h>
+#include <cassert>
#include <vector>
/**
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index b35dc6f..9487e3b 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -4,15 +4,15 @@
#include "cmsys/RegularExpression.hxx"
#include <algorithm>
-#include <assert.h>
+#include <cassert>
#include <cstddef>
+#include <cstdio>
+#include <cstdlib> // required for atoi
#include <functional>
#include <iterator>
#include <set>
#include <sstream>
#include <stdexcept>
-#include <stdio.h>
-#include <stdlib.h> // required for atoi
#include <utility>
#include <vector>
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 349d5e9..ab53df6 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -10,7 +10,7 @@
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
-#include <assert.h>
+#include <cassert>
#include <memory>
#include <sstream>
#include <utility>
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index 5de1a74..9cae827 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -5,9 +5,9 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include <cstddef>
#include <iosfwd>
#include <memory>
-#include <stddef.h>
#include <string>
#include <utility>
#include <vector>
diff --git a/Source/cmLoadCommandCommand.cxx b/Source/cmLoadCommandCommand.cxx
index f650eb1..66fdada 100644
--- a/Source/cmLoadCommandCommand.cxx
+++ b/Source/cmLoadCommandCommand.cxx
@@ -2,12 +2,12 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmLoadCommandCommand.h"
-#include <signal.h>
+#include <csignal>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
#include <sstream>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <utility>
#include "cm_memory.hxx"
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 51eb78c..5bbb83c 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -38,15 +38,15 @@
#endif
#include <algorithm>
-#include <assert.h>
+#include <cassert>
+#include <cstdio>
#include <cstdlib>
+#include <cstring>
#include <functional>
#include <initializer_list>
#include <iterator>
#include <memory>
#include <sstream>
-#include <stdio.h>
-#include <string.h>
#include <unordered_set>
#include <utility>
#include <vector>
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 1284d4d..0fe385f 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -3,11 +3,11 @@
#include "cmLocalNinjaGenerator.h"
#include <algorithm>
-#include <assert.h>
+#include <cassert>
+#include <cstdio>
#include <iterator>
#include <memory>
#include <sstream>
-#include <stdio.h>
#include <utility>
#include "cmCryptoHash.h"
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 8248608..f80695d 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -5,8 +5,8 @@
#include "cmsys/FStream.hxx"
#include "cmsys/Terminal.h"
#include <algorithm>
+#include <cstdio>
#include <sstream>
-#include <stdio.h>
#include <utility>
#include "cm_memory.hxx"
diff --git a/Source/cmLocale.h b/Source/cmLocale.h
index 3580ec8..c44a42d 100644
--- a/Source/cmLocale.h
+++ b/Source/cmLocale.h
@@ -5,7 +5,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
-#include <locale.h>
+#include <clocale>
#include <string>
class cmLocaleRAII
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index ef6a705..af97761 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -2,7 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmMacroCommand.h"
-#include <stdio.h>
+#include <cstdio>
#include <utility>
#include "cm_memory.hxx"
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index caf4168..88d03f9 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -5,14 +5,14 @@
#include "cmsys/FStream.hxx"
#include "cmsys/RegularExpression.hxx"
#include <algorithm>
-#include <assert.h>
+#include <cassert>
+#include <cctype>
+#include <cstdio>
+#include <cstdlib>
#include <cstring>
-#include <ctype.h>
#include <iterator>
#include <memory>
#include <sstream>
-#include <stdio.h>
-#include <stdlib.h>
#include <utility>
#include "cmAlgorithms.h"
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index e32e4b3..1944879 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -6,13 +6,13 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmsys/RegularExpression.hxx"
+#include <cstddef>
#include <deque>
#include <functional>
#include <map>
#include <memory>
#include <set>
#include <stack>
-#include <stddef.h>
#include <string>
#include <unordered_map>
#include <vector>
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 6d71a6d..b37a933 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -2,9 +2,9 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmMakefileLibraryTargetGenerator.h"
+#include <cstddef>
#include <set>
#include <sstream>
-#include <stddef.h>
#include <utility>
#include <vector>
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 1f6986b..477badd 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -2,9 +2,9 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmMakefileTargetGenerator.h"
+#include <cstdio>
#include <memory>
#include <sstream>
-#include <stdio.h>
#include <utility>
#include "cmAlgorithms.h"
diff --git a/Source/cmMathCommand.cxx b/Source/cmMathCommand.cxx
index 83c22aa..4ea3638 100644
--- a/Source/cmMathCommand.cxx
+++ b/Source/cmMathCommand.cxx
@@ -8,7 +8,7 @@
#include "cmMessageType.h"
#include "cm_kwiml.h"
-#include <stdio.h>
+#include <cstdio>
namespace {
bool HandleExprCommand(std::vector<std::string> const& args,
diff --git a/Source/cmNewLineStyle.cxx b/Source/cmNewLineStyle.cxx
index 1ff741e..a121332 100644
--- a/Source/cmNewLineStyle.cxx
+++ b/Source/cmNewLineStyle.cxx
@@ -2,7 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmNewLineStyle.h"
-#include <stddef.h>
+#include <cstddef>
cmNewLineStyle::cmNewLineStyle() = default;
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index bc2506e..97742c1 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -3,7 +3,7 @@
#include "cmNinjaNormalTargetGenerator.h"
#include <algorithm>
-#include <assert.h>
+#include <cassert>
#include <iterator>
#include <map>
#include <set>
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 90b59e7..37e9e0e 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -5,7 +5,7 @@
#include "cm_jsoncpp_value.h"
#include "cm_jsoncpp_writer.h"
#include <algorithm>
-#include <assert.h>
+#include <cassert>
#include <iterator>
#include <map>
#include <ostream>
diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx
index c8cac3b..e1267ec 100644
--- a/Source/cmOrderDirectories.cxx
+++ b/Source/cmOrderDirectories.cxx
@@ -11,7 +11,7 @@
#include "cmake.h"
#include <algorithm>
-#include <assert.h>
+#include <cassert>
#include <functional>
#include <sstream>
#include <vector>
diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index bf516e3..e602a6d 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -3,8 +3,8 @@
#include "cmOutputConverter.h"
#include <algorithm>
-#include <assert.h>
-#include <ctype.h>
+#include <cassert>
+#include <cctype>
#include <set>
#include <vector>
diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx
index 2f4e003..d9a433d 100644
--- a/Source/cmOutputRequiredFilesCommand.cxx
+++ b/Source/cmOutputRequiredFilesCommand.cxx
@@ -4,9 +4,9 @@
#include "cmsys/FStream.hxx"
#include "cmsys/RegularExpression.hxx"
+#include <cstdio>
#include <map>
#include <set>
-#include <stdio.h>
#include <utility>
#include "cmAlgorithms.h"
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index d33cd32..c8bc56d 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -8,11 +8,11 @@
#include "cmSystemTools.h"
#include "cmVersion.h"
-#include <assert.h>
-#include <ctype.h>
+#include <cassert>
+#include <cctype>
+#include <cstdio>
+#include <cstring>
#include <sstream>
-#include <stdio.h>
-#include <string.h>
#include <vector>
static bool stringToId(const char* input, cmPolicies::PolicyID& pid)
diff --git a/Source/cmProcessOutput.h b/Source/cmProcessOutput.h
index 400354c..3db47a4 100644
--- a/Source/cmProcessOutput.h
+++ b/Source/cmProcessOutput.h
@@ -5,7 +5,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
-#include <stddef.h>
+#include <cstddef>
#include <string>
#include <vector>
diff --git a/Source/cmProcessTools.h b/Source/cmProcessTools.h
index c205a8f..7d97e36 100644
--- a/Source/cmProcessTools.h
+++ b/Source/cmProcessTools.h
@@ -6,8 +6,8 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmProcessOutput.h"
+#include <cstring>
#include <iosfwd>
-#include <string.h>
#include <string>
/** \class cmProcessTools
diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx
index aa394e5..edbb3de 100644
--- a/Source/cmRST.cxx
+++ b/Source/cmRST.cxx
@@ -10,9 +10,9 @@
#include "cmsys/FStream.hxx"
#include <algorithm>
-#include <ctype.h>
+#include <cctype>
+#include <cstddef>
#include <iterator>
-#include <stddef.h>
#include <utility>
cmRST::cmRST(std::ostream& os, std::string docroot)
diff --git a/Source/cmRulePlaceholderExpander.cxx b/Source/cmRulePlaceholderExpander.cxx
index 6c954a6..0a1d109 100644
--- a/Source/cmRulePlaceholderExpander.cxx
+++ b/Source/cmRulePlaceholderExpander.cxx
@@ -2,8 +2,8 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmRulePlaceholderExpander.h"
-#include <ctype.h>
-#include <string.h>
+#include <cctype>
+#include <cstring>
#include <utility>
#include "cmOutputConverter.h"
diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx
index 0e8d09d..bd75c14 100644
--- a/Source/cmSourceFileLocation.cxx
+++ b/Source/cmSourceFileLocation.cxx
@@ -9,7 +9,7 @@
#include "cmSystemTools.h"
#include "cmake.h"
-#include <assert.h>
+#include <cassert>
cmSourceFileLocation::cmSourceFileLocation() = default;
diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx
index c239a1f..3be7fec 100644
--- a/Source/cmSourceGroupCommand.cxx
+++ b/Source/cmSourceGroupCommand.cxx
@@ -2,8 +2,8 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmSourceGroupCommand.h"
+#include <cstddef>
#include <set>
-#include <stddef.h>
#include <utility>
#include "cmAlgorithms.h"
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index 751eb77..7463bf8 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -4,9 +4,9 @@
#include "cmsys/RegularExpression.hxx"
#include <algorithm>
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
+#include <cassert>
+#include <cstdlib>
+#include <cstring>
#include <utility>
#include "cm_memory.hxx"
diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx
index c14bf4a..ede00a0 100644
--- a/Source/cmStateDirectory.cxx
+++ b/Source/cmStateDirectory.cxx
@@ -4,7 +4,7 @@
#include "cmStateDirectory.h"
#include <algorithm>
-#include <assert.h>
+#include <cassert>
#include <iterator>
#include <vector>
diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx
index b3e33ea..28d5170 100644
--- a/Source/cmStateSnapshot.cxx
+++ b/Source/cmStateSnapshot.cxx
@@ -4,7 +4,7 @@
#include "cmStateSnapshot.h"
#include <algorithm>
-#include <assert.h>
+#include <cassert>
#include <iterator>
#include <string>
diff --git a/Source/cmStringAlgorithms.cxx b/Source/cmStringAlgorithms.cxx
index 131a01e..bb6dcd7 100644
--- a/Source/cmStringAlgorithms.cxx
+++ b/Source/cmStringAlgorithms.cxx
@@ -3,10 +3,10 @@
#include "cmStringAlgorithms.h"
#include <algorithm>
+#include <cerrno>
#include <cstddef>
#include <cstdio>
-#include <errno.h>
-#include <stdlib.h>
+#include <cstdlib>
std::string cmTrimWhitespace(cm::string_view str)
{
diff --git a/Source/cmStringAlgorithms.h b/Source/cmStringAlgorithms.h
index 7f442d8..cb6b8ba 100644
--- a/Source/cmStringAlgorithms.h
+++ b/Source/cmStringAlgorithms.h
@@ -8,9 +8,9 @@
#include "cmRange.h"
#include "cm_string_view.hxx"
#include <cctype>
+#include <cstring>
#include <initializer_list>
#include <sstream>
-#include <string.h>
#include <string>
#include <utility>
#include <vector>
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index 9a2de9d..ab670ca 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -6,12 +6,12 @@
#include "cmsys/RegularExpression.hxx"
#include <algorithm>
-#include <ctype.h>
+#include <cctype>
+#include <cstdio>
+#include <cstdlib>
#include <iterator>
#include <memory>
#include <sstream>
-#include <stdio.h>
-#include <stdlib.h>
#include "cm_static_string_view.hxx"
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 86af683..62a8d8f 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -40,16 +40,16 @@
#include "cmsys/System.h"
#include "cmsys/Terminal.h"
#include <algorithm>
-#include <assert.h>
-#include <ctype.h>
-#include <errno.h>
+#include <cassert>
+#include <cctype>
+#include <cerrno>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
#include <fcntl.h>
#include <iostream>
#include <sstream>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
#include <utility>
#include <vector>
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index 8ca4939..e7eef33 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -11,8 +11,8 @@
#include "cm_string_view.hxx"
#include "cmsys/Process.h"
#include "cmsys/SystemTools.hxx" // IWYU pragma: export
+#include <cstddef>
#include <functional>
-#include <stddef.h>
#include <string>
#include <vector>
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 2420810..6637e32 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -4,12 +4,12 @@
#include "cmsys/RegularExpression.hxx"
#include <algorithm>
-#include <assert.h>
+#include <cassert>
+#include <cstring>
#include <initializer_list>
#include <iterator>
#include <set>
#include <sstream>
-#include <string.h>
#include <unordered_set>
#include "cm_memory.hxx"
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 4fbec90..237d90c 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -2,8 +2,8 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmTargetLinkLibrariesCommand.h"
+#include <cstring>
#include <sstream>
-#include <string.h>
#include "cmGeneratorExpression.h"
#include "cmGlobalGenerator.h"
diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx
index a9be729..390fd16 100644
--- a/Source/cmTimestamp.cxx
+++ b/Source/cmTimestamp.cxx
@@ -2,9 +2,9 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmTimestamp.h"
+#include <cstdlib>
#include <cstring>
#include <sstream>
-#include <stdlib.h>
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
diff --git a/Source/cmTimestamp.h b/Source/cmTimestamp.h
index d5fbdfd..40338f8 100644
--- a/Source/cmTimestamp.h
+++ b/Source/cmTimestamp.h
@@ -5,8 +5,8 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include <ctime>
#include <string>
-#include <time.h>
/** \class cmTimestamp
* \brief Utility class to generate string representation of a timestamp
diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx
index 24d0f0f..73354ec 100644
--- a/Source/cmTryRunCommand.cxx
+++ b/Source/cmTryRunCommand.cxx
@@ -3,7 +3,7 @@
#include "cmTryRunCommand.h"
#include "cmsys/FStream.hxx"
-#include <stdio.h>
+#include <cstdio>
#include "cmDuration.h"
#include "cmMakefile.h"
diff --git a/Source/cmUVHandlePtr.cxx b/Source/cmUVHandlePtr.cxx
index 97c27cb..23dabb7 100644
--- a/Source/cmUVHandlePtr.cxx
+++ b/Source/cmUVHandlePtr.cxx
@@ -3,9 +3,9 @@
#define cmUVHandlePtr_cxx
#include "cmUVHandlePtr.h"
-#include <assert.h>
+#include <cassert>
+#include <cstdlib>
#include <mutex>
-#include <stdlib.h>
#include "cm_uv.h"
diff --git a/Source/cmUVProcessChain.cxx b/Source/cmUVProcessChain.cxx
index 56d6c09..2c37a64 100644
--- a/Source/cmUVProcessChain.cxx
+++ b/Source/cmUVProcessChain.cxx
@@ -7,7 +7,7 @@
#include "cmUVStreambuf.h"
#include "cm_uv.h"
-#include <assert.h>
+#include <cassert>
#include <istream> // IWYU pragma: keep
#include <iterator>
diff --git a/Source/cmUVProcessChain.h b/Source/cmUVProcessChain.h
index 76a9c40..8a19bc3 100644
--- a/Source/cmUVProcessChain.h
+++ b/Source/cmUVProcessChain.h
@@ -7,13 +7,12 @@
#include <array>
#include <cstddef>
+#include <cstdint>
#include <iosfwd>
#include <memory>
#include <string>
#include <vector>
-#include <stdint.h>
-
class cmUVProcessChain;
class cmUVProcessChainBuilder
diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx
index 6b3590f..a43165c 100644
--- a/Source/cmUtilitySourceCommand.cxx
+++ b/Source/cmUtilitySourceCommand.cxx
@@ -2,7 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmUtilitySourceCommand.h"
-#include <string.h>
+#include <cstring>
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
diff --git a/Source/cmUuid.cxx b/Source/cmUuid.cxx
index 91c8af3..f0f2c51 100644
--- a/Source/cmUuid.cxx
+++ b/Source/cmUuid.cxx
@@ -5,7 +5,7 @@
#include "cmCryptoHash.h"
#include <array>
-#include <string.h>
+#include <cstring>
static const std::array<int, 5> kUuidGroups = { { 4, 2, 2, 2, 6 } };
diff --git a/Source/cmWorkerPool.cxx b/Source/cmWorkerPool.cxx
index 2e4d00b..5ac81df 100644
--- a/Source/cmWorkerPool.cxx
+++ b/Source/cmWorkerPool.cxx
@@ -11,10 +11,10 @@
#include <algorithm>
#include <array>
#include <condition_variable>
+#include <cstddef>
#include <deque>
#include <functional>
#include <mutex>
-#include <stddef.h>
#include <thread>
#include "cm_memory.hxx"
diff --git a/Source/cmWorkerPool.h b/Source/cmWorkerPool.h
index b541ce3..bf07299 100644
--- a/Source/cmWorkerPool.h
+++ b/Source/cmWorkerPool.h
@@ -5,7 +5,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
-#include <stdint.h>
+#include <cstdint>
#include <string>
#include <utility>
#include <vector>
diff --git a/Source/cmXMLParser.cxx b/Source/cmXMLParser.cxx
index 4c6c35a..1f69032 100644
--- a/Source/cmXMLParser.cxx
+++ b/Source/cmXMLParser.cxx
@@ -4,10 +4,10 @@
#include "cm_expat.h"
#include "cmsys/FStream.hxx"
-#include <ctype.h>
+#include <cctype>
+#include <cstring>
#include <iostream>
#include <sstream>
-#include <string.h>
cmXMLParser::cmXMLParser()
{
diff --git a/Source/cmXMLSafe.cxx b/Source/cmXMLSafe.cxx
index d9bdc02..7c3b306 100644
--- a/Source/cmXMLSafe.cxx
+++ b/Source/cmXMLSafe.cxx
@@ -4,9 +4,9 @@
#include "cm_utf8.h"
+#include <cstdio>
+#include <cstring>
#include <sstream>
-#include <stdio.h>
-#include <string.h>
cmXMLSafe::cmXMLSafe(const char* s)
: Data(s)
diff --git a/Source/cm_codecvt.hxx b/Source/cm_codecvt.hxx
index 2060584..b2cb9e6 100644
--- a/Source/cm_codecvt.hxx
+++ b/Source/cm_codecvt.hxx
@@ -5,8 +5,8 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include <cwchar>
#include <locale>
-#include <wchar.h>
class codecvt : public std::codecvt<char, char, mbstate_t>
{
diff --git a/Source/cm_get_date.h b/Source/cm_get_date.h
index 6acf8de..38a690e 100644
--- a/Source/cm_get_date.h
+++ b/Source/cm_get_date.h
@@ -3,7 +3,7 @@
#ifndef cm_get_date_h
#define cm_get_date_h
-#include <time.h>
+#include <time.h> /* NOLINT(modernize-deprecated-headers) */
#ifdef __cplusplus
extern "C" {
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 170e09b..9a66805 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -105,12 +105,12 @@
#include "cmsys/Glob.hxx"
#include "cmsys/RegularExpression.hxx"
#include <algorithm>
+#include <cstdio>
+#include <cstdlib>
#include <cstring>
#include <initializer_list>
#include <iostream>
#include <sstream>
-#include <stdio.h>
-#include <stdlib.h>
#include <utility>
namespace {
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 2b51a2a..252c6d6 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -25,10 +25,10 @@
#endif
#include <cassert>
+#include <cctype>
#include <climits>
-#include <ctype.h>
+#include <cstring>
#include <iostream>
-#include <string.h>
#include <string>
#include <vector>
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index ba2ba33..211fd4c 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -39,13 +39,13 @@
#include "cmsys/Process.h"
#include "cmsys/Terminal.h"
#include <array>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
#include <iostream>
#include <memory>
#include <sstream>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
#include <utility>
class cmConnection;
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index a69ba15..7be6746 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -11,8 +11,8 @@
#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP)
# include "cmsys/ConsoleBuf.hxx"
#endif
+#include <cstring>
#include <iostream>
-#include <string.h>
#include <string>
#include <vector>
diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx
index 010e17a..4a79c80 100644
--- a/Tests/CMakeLib/run_compile_commands.cxx
+++ b/Tests/CMakeLib/run_compile_commands.cxx
@@ -1,9 +1,9 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmsys/FStream.hxx"
+#include <cstdlib>
#include <iostream>
#include <map>
-#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>