lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 6e590f5c 01/13: Work around a spurious gcc 12


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 6e590f5c 01/13: Work around a spurious gcc 12 -Wnull-dereference
Date: Wed, 27 Jul 2022 15:16:33 -0400 (EDT)

branch: master
commit 6e590f5cd99dfd6f1db8fc1bf245470cf4eba50f
Author: Vadim Zeitlin <vadim@tt-solutions.com>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Work around a spurious gcc 12 -Wnull-dereference
    
    Move std::sort() before std::insert_iterator ctor to avoid triggering a
    spurious warning inside std::unique_copy().
    
    See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106434
---
 census_view.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/census_view.cpp b/census_view.cpp
index 66635eab..58e77db5 100644
--- a/census_view.cpp
+++ b/census_view.cpp
@@ -1159,6 +1159,7 @@ void CensusView::update_class_names()
         {
         all_class_names.push_back(i["EmployeeClass"].str());
         }
+    std::sort(all_class_names.begin(), all_class_names.end());
 
     std::vector<std::string> unique_class_names;
 
@@ -1166,7 +1167,6 @@ void CensusView::update_class_names()
         (unique_class_names
         ,unique_class_names.begin()
         );
-    std::sort(all_class_names.begin(), all_class_names.end());
     std::unique_copy(all_class_names.begin(), all_class_names.end(), iin);
 
     // Rebuild vector of class parameters so that it contains



reply via email to

[Prev in Thread] Current Thread [Next in Thread]