From 13ab9fbf36165f707dd5e7dbeebc4e964fc8aefa Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 17 May 2022 14:29:47 -0400 Subject: cmMakefileLibraryTargetGenerator: improve output building GCC warns about buffer juggling here. To avoid the warning, improve the code to avoid resizing on the following two pushes. --- Source/cmMakefileLibraryTargetGenerator.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 66031db..21b91e0 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -929,7 +929,9 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( } // Compute the list of outputs. - std::vector outputs(1, targetFullPathReal); + std::vector outputs; + outputs.reserve(3); + outputs.push_back(targetFullPathReal); if (this->TargetNames.SharedObject != this->TargetNames.Real) { outputs.push_back(targetFullPathSO); } -- cgit v0.12