Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build on 32 bit arches #1902

Closed
wants to merge 1 commit into from
Closed

Conversation

david-geiger
Copy link

No description provided.

@david-geiger
Copy link
Author

david-geiger commented Apr 3, 2024

Mageia Cauldron + GCC14:

On 32bit arches without this patch we got this following build issue:

In file included from /home/iurt/rpmbuild/BUILD/gnucash-5.6/libgnucash/engine/qof.h:74, from /home/iurt/rpmbuild/BUILD/gnucash-5.6/libgnucash/engine/gnc-engine.h:41, from /home/iurt/rpmbuild/BUILD/gnucash-5.6/libgnucash/engine/gnc-commodity.h:55, from /home/iurt/rpmbuild/BUILD/gnucash-5.6/libgnucash/engine/Transaction.h:93, from /home/iurt/rpmbuild/BUILD/gnucash-5.6/gnucash/import-export/import-main-matcher.h:40, from /home/iurt/rpmbuild/BUILD/gnucash-5.6/gnucash/import-export/import-main-matcher.cpp:45: /home/iurt/rpmbuild/BUILD/gnucash-5.6/gnucash/import-export/import-main-matcher.cpp: In function 'void gnc_gen_trans_assign_transfer_account_to_selection_cb(GtkMenuItem*, GNCImportMainMatcher*)': /home/iurt/rpmbuild/BUILD/gnucash-5.6/libgnucash/engine/qoflog.h:267:16: error: format '%ld' expects argument of type 'long int', but argument 5 has type 'std::vector<std::unique_ptr<_GtkTreeRowReference, TreeRowRefDestructor> >::size_type' {aka 'unsigned int'} [-Werror=format=] 267 | "[%s] " format, PRETTY_FUNC_NAME , ## args); \ /home/iurt/rpmbuild/BUILD/gnucash-5.6/gnucash/import-export/import-main-matcher.cpp:850:5: note: in expansion of macro 'DEBUG' 850 | DEBUG("Rows in selection = %ld", selected_refs.size()); | ^~~~~ /home/iurt/rpmbuild/BUILD/gnucash-5.6/gnucash/import-export/import-main-matcher.cpp:850:34: note: format string is defined here 850 | DEBUG("Rows in selection = %ld", selected_refs.size()); | ~~^ | | | long int | %d cc1plus: all warnings being treated as errors

@christopherlam
Copy link
Contributor

Does %zu work?

@jralls
Copy link
Member

jralls commented Apr 4, 2024

Does %zu work?

See #1904

@christopherlam
Copy link
Contributor

Ok. Would it be an idea to including 32-bit builds on CI?

@jralls
Copy link
Member

jralls commented Apr 4, 2024

Ok. Would it be an idea to including 32-bit builds on CI?

We do sort of with the Windows nightlies, but apparently MSYS2's version of gcc didn't flag up this parameter mismatch.

@madpilot78
Copy link
Contributor

madpilot78 commented Apr 4, 2024

Does %zu work?

See #1904

I have tested my patch with %zu on FreeBSD, and it works fine there for compiling. I am not sure how to get that debug code to actually execute.

BTW I'm using my patch in the FreeBSD ports tree at present: freebsd/freebsd-ports@3abcd80

@jralls
Copy link
Member

jralls commented Apr 4, 2024

To execute the debug statement start GnuCash with --log gnc.import.main-matcher=debug and import a file.

%zu is more correct than casting the size_t to long int so we'll go with #1904.

@jralls jralls closed this Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants