gnucash future: Fix printf format size error on 64-bit Windows (%ld won't format a size_t)

John Ralls jralls at code.gnucash.org
Tue Jun 30 18:56:58 EDT 2026


Updated	 via  https://github.com/Gnucash/gnucash/commit/35029adc (commit)
	from  https://github.com/Gnucash/gnucash/commit/e5142dfd (commit)



commit 35029adc47d11e263926c74d173d450e5a116278
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Jun 30 15:55:53 2026 -0700

    Fix printf format size error on 64-bit Windows (%ld won't format a size_t)

diff --git a/libgnucash/engine/qofid.cpp b/libgnucash/engine/qofid.cpp
index cde7fd524e..364ae44f82 100644
--- a/libgnucash/engine/qofid.cpp
+++ b/libgnucash/engine/qofid.cpp
@@ -26,7 +26,7 @@
 
 #include <config.h>
 #include <string.h>
-
+#include <inttypes.h>
 #include <guid.hpp>
 #include "qof.h"
 #include "qofid-p.h"
@@ -266,7 +266,7 @@ qof_collection_foreach_sorted (const QofCollection *col, QofInstanceForeachCB cb
     g_return_if_fail (col);
     g_return_if_fail (cb_func);
 
-    PINFO("Hash Table size of %s before is %ld", col->e_type, col->guid_entity_map.size());
+    PINFO("Hash Table size of %s before is %" PRIi64, col->e_type, col->guid_entity_map.size());
 
     std::vector<QofInstance*> entries (col->guid_entity_map.size());
     std::transform (col->guid_entity_map.cbegin(), col->guid_entity_map.cend(),
@@ -277,7 +277,7 @@ qof_collection_foreach_sorted (const QofCollection *col, QofInstanceForeachCB cb
     std::for_each (entries.cbegin(), entries.cend(),
                    [&](auto ent) { cb_func (ent, user_data); });
 
-    PINFO("Hash Table size of %s after is %ld", col->e_type, col->guid_entity_map.size());
+    PINFO("Hash Table size of %s after is %" PRIi64, col->e_type, col->guid_entity_map.size());
 }
 
 void



Summary of changes:
 libgnucash/engine/qofid.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)



More information about the gnucash-changes mailing list