gnucash stable: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Tue Jan 13 17:46:03 EST 2026


Updated	 via  https://github.com/Gnucash/gnucash/commit/bab04728 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/7a4548bf (commit)
	 via  https://github.com/Gnucash/gnucash/commit/bfb8647f (commit)
	 via  https://github.com/Gnucash/gnucash/commit/622c35cf (commit)
	 via  https://github.com/Gnucash/gnucash/commit/b028f50f (commit)
	from  https://github.com/Gnucash/gnucash/commit/2f94d161 (commit)



commit bab04728f4427383a4b4ee061b0da7437ec2dd6a
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Jan 13 14:07:29 2026 -0800

    search-reconciled.c: Use uintptr_t instead of specializing on pointer size.

diff --git a/gnucash/gnome-search/search-reconciled.c b/gnucash/gnome-search/search-reconciled.c
index 4ec704979e..2ecd9aacac 100644
--- a/gnucash/gnome-search/search-reconciled.c
+++ b/gnucash/gnome-search/search-reconciled.c
@@ -151,13 +151,8 @@ static void
 toggle_changed (GtkToggleButton *button, GNCSearchReconciled *fe)
 {
     gboolean is_on = gtk_toggle_button_get_active (button);
-#ifdef __LP64__
     cleared_match_t value =
-        (cleared_match_t) ((uint64_t)g_object_get_data (G_OBJECT (button), "button-value") & 0xffffffff); // Binary mask to silence void-pointer-to-enum-cast warning.
-#else
-    cleared_match_t value =
-	(cleared_match_t)g_object_get_data (G_OBJECT (button), "button-value");
-#endif
+        (cleared_match_t) ((uintptr_t)g_object_get_data (G_OBJECT (button), "button-value") & 0xffffffff); // Binary mask to silence void-pointer-to-enum-cast warning.
 
     if (is_on)
         fe->value |= value;

commit 7a4548bf69f947f504ed7e7a542a8e64e5c7653a
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Jan 13 14:04:15 2026 -0800

    Modernize strptime.c: prototypes up top and inline parameter type decls.

diff --git a/borrowed/libc/strptime.c b/borrowed/libc/strptime.c
index 58af36ff11..ea2d47ffc5 100644
--- a/borrowed/libc/strptime.c
+++ b/borrowed/libc/strptime.c
@@ -38,6 +38,13 @@
 
 #include "strptime.h"
 
+/* Status of lookup: do we use the locale data or the raw data?  */
+enum locale_status { not, loc, raw };
+
+static char *
+strptime_internal (const char *rp, const char *fmt, struct tm *tm,
+                    enum locale_status *decided, int era_cnt);
+
 
 #ifdef OS_WIN32
 /* The localtime_r() definition in pthreads-win32's pthread.h doesn't guard
@@ -370,9 +377,6 @@ const unsigned short int __mon_yday[2][13] =
 };
 #endif
 
-/* Status of lookup: do we use the locale data or the raw data?  */
-enum locale_status { not, loc, raw };
-
 
 #ifndef __isleap
 /* Nonzero if YEAR is a leap year (every 4 years,
@@ -411,19 +415,7 @@ static char *
 #ifdef _LIBC
 internal_function
 #endif
-strptime_internal __P ((const char *rp, const char *fmt, struct tm *tm,
-                        enum locale_status *decided, int era_cnt));
-
-static char *
-#ifdef _LIBC
-internal_function
-#endif
-strptime_internal (rp, fmt, tm, decided, era_cnt)
-const char *rp;
-const char *fmt;
-struct tm *tm;
-enum locale_status *decided;
-int era_cnt;
+strptime_internal (const char *rp,const char *fmt, struct tm *tm, enum locale_status *decided, int era_cnt)
 {
     const char *rp_backup;
     int cnt;
@@ -1372,10 +1364,7 @@ match_year_in_century:
 
 
 char *
-strptime (buf, format, tm)
-const char *buf;
-const char *format;
-struct tm *tm;
+strptime (const char *buf, const char *format, struct tm *tm)
 {
     enum locale_status decided;
 

commit bfb8647f5c3361f2c179c3fe5b9ab421d0fd567a
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Jan 13 14:02:38 2026 -0800

    Clang on Windows has a different std c++ library and doesn't have a special exception library.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 671a204267..4042323745 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1058,17 +1058,25 @@ install(CODE
 #For windows, copy in some DLLs from Mingw
 
 if (WIN32)
+if ($ENV{MSYSTEM} STREQUAL "CLANG64")
+  find_file(LIBSTDC++ libc++.dll)
+else()
   find_file(LIBSTDC++ libstdc++-6.dll)
+endif()
   if (NOT LIBSTDC++)
     message(FATAL_ERROR "libstdc++ not found.")
   endif()
-  if ($ENV{MSYSTEM} STREQUAL "MINGW32")
-    find_file(LIBDW2 libgcc_s_dw2-1.dll)
+  if(NOT $ENV{MSYSTEM} STREQUAL "CLANG64")
+    if ($ENV{MSYSTEM} STREQUAL "MINGW32")
+      find_file(LIBDW2 libgcc_s_dw2-1.dll)
+    else()
+      find_file(LIBDW2 libgcc_s_seh-1.dll)
+    endif()
+    if (NOT LIBDW2)
+      message(FATAL_ERROR "GCC exception library not found.")
+    endif()
   else()
-    find_file(LIBDW2 libgcc_s_seh-1.dll)
-  endif()
-  if (NOT LIBDW2)
-    message(FATAL_ERROR "GCC exception library not found.")
+    set(LIBDW2 "")
   endif()
   set(MINGW_DLLS ${LIBSTDC++} ${LIBDW2})
   install(PROGRAMS ${MINGW_DLLS} DESTINATION ${CMAKE_INSTALL_BINDIR})

commit 622c35cfaa6191a7ab3a69b2682d7ea56cede993
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Jan 13 11:04:06 2026 -0800

    WORDS_BIGENDIAN needs to be a compile definition and checked with ifdef.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7ce07851e2..671a204267 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -799,7 +799,7 @@ check_include_files (wctype.h HAVE_WCTYPE_H)
 
 test_big_endian(IS_BIGENDIAN)
 if (IS_BIGENDIAN)
-  set(WORDS_BIGENDIAN)
+  add_compile_definition (WORDS_BIGENDIAN)
 endif()
 
 if (NOT DISABLE_NLS)
diff --git a/libgnucash/engine/gnc-timezone.cpp b/libgnucash/engine/gnc-timezone.cpp
index 6c17e105ea..2040aa52b1 100644
--- a/libgnucash/engine/gnc-timezone.cpp
+++ b/libgnucash/engine/gnc-timezone.cpp
@@ -49,7 +49,7 @@ template<typename T>
 T*
 endian_swap(T* t)
 {
-#if ! WORDS_BIGENDIAN
+#ifndef WORDS_BIGENDIAN
     auto memp = reinterpret_cast<unsigned char*>(t);
     std::reverse(memp, memp + sizeof(T));
 #endif

commit b028f50fa3fe7515d4232824098c9f470ae7bbf9
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Jan 13 11:02:09 2026 -0800

    A better fix for gcc ptr->int casting pickiness.

diff --git a/libgnucash/backend/sql/gnc-sql-column-table-entry.hpp b/libgnucash/backend/sql/gnc-sql-column-table-entry.hpp
index 326ba62fb1..d805e8c607 100644
--- a/libgnucash/backend/sql/gnc-sql-column-table-entry.hpp
+++ b/libgnucash/backend/sql/gnc-sql-column-table-entry.hpp
@@ -368,24 +368,8 @@ GncSqlColumnTableEntry::get_row_value_from_object(QofIdTypeConst obj_name,
         QofAccessFunc getter = get_getter(obj_name);
         if (getter != nullptr)
         {
-            if constexpr (sizeof(T) >= sizeof(void*))
-                result = reinterpret_cast<T>((getter)(const_cast<void*>(pObject),
-                                                  nullptr));
-            else
-            {
-                union converter
-                {
-                    intptr_t whole;
-                    uint32_t upper;
-                    uint32_t lower;
-                };
-                converter conv;
-                conv.whole = reinterpret_cast<intptr_t>((getter)(const_cast<void*>(pObject),
-                                                                        nullptr));
-                if (conv.upper)
-                    throw std::runtime_error("Bits left over when converting pointer"); //crash out
-                result = conv.lower;
-            }
+            result = static_cast<T>(reinterpret_cast<intptr_t>((getter)(const_cast<void*>(pObject),
+                                                                         nullptr)));
         }
     }
     return result;



Summary of changes:
 CMakeLists.txt                                     | 22 ++++++++++------
 borrowed/libc/strptime.c                           | 29 +++++++---------------
 gnucash/gnome-search/search-reconciled.c           |  7 +-----
 .../backend/sql/gnc-sql-column-table-entry.hpp     | 20 ++-------------
 libgnucash/engine/gnc-timezone.cpp                 |  2 +-
 5 files changed, 28 insertions(+), 52 deletions(-)



More information about the gnucash-changes mailing list