Herbert,

gcc 8 is the minimum required since 2019: 
https://github.com/Gnucash/gnucash/commit/e4bbf7257f6555808ffbac85e446ed0cb53c6015

According to https://software.opensuse.org/package/gcc there's no official gcc 
package for leap 15.4, but there are three community builds of gcc 12 and an 
experimental build of gcc 13. Under the heading "Unsupported distributions The 
following distributions are not officially supported. Use these packages at 
your own risk." it lists official releases and updates for gcc 7 under Leap 
15.0, 15.1, and 15.2... so I guess building software isn't a supported activity 
on openSuSE. Maybe you should consider a different distro.

In case you insist on using this obsolete compiler, I found an old Ubuntu 18.04 
VM that has gcc 7.5 and built GnuCash all the way through.

Although the static char* empty is easy to fix (and is actually wrong for a 
different reason), the next problem in gcc 7.5 is
  gnucash/gnome/dialog-report-column-view.cpp:533:29: error: unused variable 
‘id’ [-Werror=unused-variable]
         auto [id, wide, high] = r->contents_list[r->contents_selected];
and the correct work-around (since 8 and later recognize that unless an rv is 
marked no discard in the function decl that it's normal to not use all of the 
values returned in a structured binding) of marking the decl with 
[[maybe_unused]] doesn't work:

gnucash/gnome/dialog-report-column-view.cpp:533:46: error: unused variable ‘id’ 
[-Werror=unused-variable]
         [[maybe_unused]] auto [id, wide, high] =
                                              ^
so to get it to build on gcc 7 one must
--- a/gnucash/gnome/dialog-report-column-view.cpp
+++ b/gnucash/gnome/dialog-report-column-view.cpp
@@ -530,7 +530,11 @@ gnc_column_view_edit_size_cb(GtkButton * button, gpointer 
user_data)
 
     if (r->contents_list.size() > static_cast<size_t>(r->contents_selected))
     {
-        auto [id, wide, high] = r->contents_list[r->contents_selected];
+#pragma GCC diagnostic push
+#pragma GCC diagnostic warning "-Wunused-variable"
+        [[maybe_unused]] auto [id, wide, high] =
+            r->contents_list[r->contents_selected];
+#pragma GCC diagnostic pop
 
         gtk_spin_button_set_value(GTK_SPIN_BUTTON(colspin),
                                   static_cast<float>(wide));

I'm not willing to do that to support a compiler that we said we don't 4 years 
ago, but the beauty of free software is that you can patch your own repo.

Once it all builds it fails a test:
/home/john/gnucash-git/libgnucash/engine/test/test-gnc-guid.cpp:82: Failure
Value of: fail
  Actual: false
Expected: true
Parsing the bogus string should throw

That's not good, it means that passing an invalid string to create a GUID will 
generate bogus output instead of signaling an error. I don't know why it's not 
throwing and I'm not sufficiently motivated to debug it. IMO it's far safer to 
upgrade to a more up-to-date compiler.

Regards,
John Ralls

> On Apr 2, 2023, at 10:59 AM, Herbert Thoma <herbert.th...@iis.fraunhofer.de> 
> wrote:
> 
> Am 02.04.23 um 19:23 schrieb john:
>> Herbert,
>> Hmm, I tested with gcc 8, 9, 10, and 12 . What version are you using?
> 
> gcc --version
> gcc (SUSE Linux) 7.5.0
> Copyright (C) 2017 Free Software Foundation, Inc.
> 
> This is the latest stable open SUSE 15.4
> 
> Herbert.
> 
>> The SWIG version doesn't matter as long as it's at least 3.0.12.
>> Regards,
>> John Ralls
>>> On Apr 2, 2023, at 8:59 AM, Herbert Thoma <herbert.th...@iis.fraunhofer.de> 
>>> wrote:
>>> 
>>> Hi John, Maarten,
>>> 
>>> thnaks for the fixes. This error is now gone on my machine.
>>> But it finds another one a bit later:
>>> 
>>> [ 20%] Building CXX object 
>>> bindings/guile/CMakeFiles/gnucash-guile.dir/swig-engine.cpp.o
>>> /home/tma/gnucash/gnucash_cvs/build_stable/bindings/guile/swig-engine.cpp: 
>>> In function ‘GncMultichoiceOptionIndexVec scm_to_multichoices(SCM, const 
>>> GncOptionMultichoiceValue&)’:
>>> /home/tma/gnucash/gnucash_cvs/build_stable/bindings/guile/swig-engine.cpp:2153:28:
>>>  error: variable ‘empty’ set but not used [-Werror=unused-but-set-variable]
>>>         static const char* empty{""};
>>>                            ^~~~~
>>> cc1plus: all warnings being treated as errors
>>> 
>>> I understand that this is an autogenerated file. My version of swig is:
>>> 
>>> SWIG Version 3.0.12
>>> 
>>> Compiled with g++ [x86_64-suse-linux-gnu]
>>> 
>>> Configured options: +pcre
>>> 
>>> Best,
>>> Herbert.
>>> 
>>> Am 02.04.23 um 17:36 schrieb john:
>>>>> On Apr 2, 2023, at 1:38 AM, Maarten Bosmans <mkbosm...@gmail.com> wrote:
>>>>> 
>>>>> Op ma 27 mrt 2023 om 17:59 schreef Herbert Thoma
>>>>> <herbert.th...@iis.fraunhofer.de>:
>>>>>> /home/tma/gnucash/gnucash_cvs/gnucash_stable/libgnucash/engine/gnc-option.cpp:448:35:
>>>>>>    required from here
>>>>>> /home/tma/gnucash/gnucash_cvs/gnucash_stable/libgnucash/engine/gnc-option-impl.hpp:331:45:
>>>>>>  error: variable ‘value’ set but not used 
>>>>>> [-Werror=unused-but-set-variable]
>>>>>> cc1plus: all warnings being treated as errors
>>>>> 
>>>>> This is fixed in my PR #1582  (
>>>>> https://github.com/Gnucash/gnucash/pull/1582/commits/9a3316bea883e46737abc12d35e76e625de3c2e2
>>>>> )
>>>>> I still need to push a new version of that though, taking care of all
>>>>> the review remarks that I got.
>>>> That along with other workarounds for deficiencies in gcc 8 & 9, is 
>>>> already committed in 
>>>> https://github.com/Gnucash/gnucash/commit/9fa2a48fe17ead2791b9481ef9ce61a2ac8ddbeb.
>>>> Regards,
>>>> John Ralls
>>>> _______________________________________________
>>>> gnucash-devel mailing list
>>>> gnucash-devel@gnucash.org
>>>> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>> _______________________________________________
>> gnucash-devel mailing list
>> gnucash-devel@gnucash.org
>> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
> 
> -- 
> Herbert Thoma
> Dipl.-Ing., MBA
> Head of Video Group
> Multimedia Applications Department
> Fraunhofer IIS
> Am Wolfsmantel 33, 91058 Erlangen, Germany
> Phone: +49-9131-776-6130
> Fax:   +49-9131-776-6099
> email: herbert.th...@iis.fraunhofer.de
> www: http://www.iis.fraunhofer.de/

_______________________________________________
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to