gnucash master: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Sat Mar 11 17:24:06 EST 2023


Updated	 via  https://github.com/Gnucash/gnucash/commit/0cfe771f (commit)
	 via  https://github.com/Gnucash/gnucash/commit/7ec99e11 (commit)
	from  https://github.com/Gnucash/gnucash/commit/35c3cef1 (commit)



commit 0cfe771fb7a3a9ae54d8e9768437f08b4c4aadef
Merge: 35c3cef157 7ec99e116a
Author: John Ralls <jralls at ceridwen.us>
Date:   Sat Mar 11 14:23:37 2023 -0800

    Merge Richard Cohen's 'fix-constructor-misuse' into master.


commit 7ec99e116a5d3736636a33e769863021df495c61
Author: Richard Cohen <richard at daijobu.co.uk>
Date:   Wed Mar 1 18:22:10 2023 +0000

    Fix  CoreApp() constructor misuse
    
    - spotted by [bugprone-undelegated-constructor] [bugprone-unused-raii]
    
    gnucash/gnucash-core-app.cpp:218:5: warning: did you intend to call a delegated constructor? A temporary object is created here instead [bugprone-undelegated-constructor]
        CoreApp();
        ^
    gnucash/gnucash-core-app.cpp:218:5: warning: object destroyed immediately after creation; did you mean to name the object? [bugprone-unused-raii]
        CoreApp();
        ^      ~~
                give_me_a_name

diff --git a/gnucash/gnucash-core-app.cpp b/gnucash/gnucash-core-app.cpp
index 1687293b14..f307e6ab94 100644
--- a/gnucash/gnucash-core-app.cpp
+++ b/gnucash/gnucash-core-app.cpp
@@ -167,7 +167,7 @@ gnc_log_init (const std::vector <std::string> log_flags,
     }
 }
 
-Gnucash::CoreApp::CoreApp ()
+Gnucash::CoreApp::CoreApp (const char* app_name) : m_app_name {app_name}
 {
     #ifdef ENABLE_BINRELOC
     {
@@ -210,14 +210,6 @@ Gnucash::CoreApp::CoreApp ()
     std::cerr.imbue (gnc_get_boost_locale());
     std::cout.imbue (gnc_get_boost_locale());
     g_free(localedir);
-}
-
-Gnucash::CoreApp::CoreApp (const char* app_name)
-{
-
-    CoreApp();
-
-    m_app_name = std::string(app_name);
 
     // Now that gettext is properly initialized, set our help tagline.
     m_tagline = _("- GnuCash, accounting for personal and small business finance");
diff --git a/gnucash/gnucash-core-app.hpp b/gnucash/gnucash-core-app.hpp
index b7b1bf40dc..4a4ded5102 100644
--- a/gnucash/gnucash-core-app.hpp
+++ b/gnucash/gnucash-core-app.hpp
@@ -39,7 +39,6 @@ namespace bpo = boost::program_options;
 class CoreApp
 {
 public:
-    CoreApp ();
     CoreApp (const char* app_name);
 
     void parse_command_line (int argc, char **argv);



Summary of changes:
 gnucash/gnucash-core-app.cpp | 10 +---------
 gnucash/gnucash-core-app.hpp |  1 -
 2 files changed, 1 insertion(+), 10 deletions(-)



More information about the gnucash-changes mailing list