commit 394ece97028f554022014ad299c32eddc82d36f8 from: Oliver Lowe date: Mon Sep 1 07:20:42 2025 UTC Drop support for y2038 unfixed systems musl libc converted to 64-bit time_t on 32-bit systems already commit - 425dbb6554835694af498b06491634c96b73f3ab commit + 394ece97028f554022014ad299c32eddc82d36f8 blob - 2fb77e64397a7d036031f65412159ac6cccc499b blob + e346a5bf8e04ed1157da348a1ff1ffa2e7f47ea7 --- configure.ac +++ configure.ac @@ -107,27 +107,6 @@ AC_SYS_LARGEFILE LDFLAGS="$LDFLAGS -Wl,--export-dynamic" -AC_MSG_CHECKING([for time_t format specifier]) -_gcc_cflags_save=$CFLAGS -CFLAGS="-Wformat -Werror" -AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[ - #include - #include - ]],[[printf("%lld", time(NULL));]])], - [time_t_long_long=yes], - [time_t_long_long=no]) -CFLAGS=$_gcc_cflags_save - -if test x"$time_t_long_long" = xyes; then - time_t_fmt=lld -else - time_t_fmt=ld -fi -AC_MSG_RESULT([$time_t_fmt]) -AC_DEFINE_UNQUOTED([CM_TIME_FORMAT], ["$time_t_fmt"], - [Define printf format specifier for time_t]) - AM_CFLAGS="-Wall" if test $USE_MAINTAINER_MODE = yes; then AM_CFLAGS="$AM_CFLAGS -g" @@ -141,7 +120,6 @@ AM_ICONV dnl floor and ceil are in -lm LIBS="$LIBS -lm" -dnl for gettext GETTEXT_PACKAGE=claws-mail AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define text domain.]) @@ -214,10 +192,6 @@ dnl Checks for library functions. AC_FUNC_ALLOCA AC_CHECK_FUNCS(strcasestr) -dnl ***************** -dnl ** common code ** -dnl ***************** - dnl check for glib PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.50 gmodule-2.0 >= 2.50 gobject-2.0 >= 2.50 gthread-2.0 >= 2.50]) blob - 6317f027998421a9416b3f56a0a20c8a0ca29f57 blob + 4e403092f7d47cf3911579c95d2a6a20f874512c --- src/common/utils.c +++ src/common/utils.c @@ -3863,7 +3863,7 @@ size_t fast_strftime(gchar *buf, gint buflen, const gc *curpos++ = '0'+(lt->tm_min % 10); break; case 's': - snprintf(subbuf, 64, "%" CM_TIME_FORMAT, mktime(lt)); + snprintf(subbuf, 64, "%lld", mktime(lt)); len = strlen(subbuf); CHECK_SIZE(); strncpy2(curpos, subbuf, buflen - total_done); break; blob - 921ce2c4325d512f5db9ab1eebe80decfcf3009e blob + d649c4ee484598bbb1d032a386a0b47cd92c64ce --- src/common/xml.c +++ src/common/xml.c @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * */ #ifdef HAVE_CONFIG_H @@ -36,7 +36,7 @@ /* if this is defined all attr.names and tag.names are stored * in a hash table */ #if defined(SPARSE_MEMORY) -#include "stringtable.h" +#include "stringtable.h" static StringTable *xml_string_table; static XMLTag *xml_copy_tag (XMLTag *tag); @@ -254,7 +254,7 @@ next: buf[len - 1] = '\0'; g_strchomp(buf); } - + if (strlen(buf) == 0) { g_warning("xml_parse_next_tag(): tag name is empty in %s", file->path); return -1; @@ -474,25 +474,25 @@ XMLNode *xml_node_new(XMLTag *tag, const gchar *text) XMLTag *xml_tag_new(const gchar *tag) { XMLTag *new_tag; - + new_tag = g_new(XMLTag, 1); if (tag) new_tag->tag = XML_STRING_ADD(tag); else new_tag->tag = NULL; new_tag->attr = NULL; - + return new_tag; } XMLAttr *xml_attr_new(const gchar *name, const gchar *value) { XMLAttr *new_attr; - + new_attr = g_new(XMLAttr, 1); new_attr->name = XML_STRING_ADD(name); new_attr->value = g_strdup(value); - + return new_attr; } @@ -506,7 +506,7 @@ XMLAttr *xml_attr_new_int(const gchar *name, const gin new_attr = g_new(XMLAttr, 1); new_attr->name = XML_STRING_ADD(name); new_attr->value = valuestr; - + return new_attr; } @@ -515,7 +515,7 @@ XMLAttr *xml_attr_new_time_t(const gchar *name, const XMLAttr *new_attr; gchar *valuestr; - valuestr = g_strdup_printf("%"CM_TIME_FORMAT, value); + valuestr = g_strdup_printf("%lld", value); new_attr = g_new(XMLAttr, 1); new_attr->name = XML_STRING_ADD(name); @@ -732,7 +732,7 @@ static int xml_write_tree_recursive(GNode *node, FILE TRY(fprintf(fp, " %s=\"", attr->name) > 0); TRY(xml_file_put_escape_str(fp, attr->value) == 0); TRY(fputs("\"", fp) != EOF); - + } if (node->children) { @@ -753,7 +753,7 @@ static int xml_write_tree_recursive(GNode *node, FILE TRY(fprintf(fp, "\n", tag->tag) > 0); } else TRY(fputs(" />\n", fp) != EOF); - + return 0; } @@ -768,7 +768,7 @@ static gpointer copy_node_func(gpointer nodedata, gpoi { XMLNode *xmlnode = (XMLNode *) nodedata; XMLNode *newxmlnode; - + newxmlnode = g_new0(XMLNode, 1); newxmlnode->tag = xml_copy_tag(xmlnode->tag); newxmlnode->element = g_strdup(xmlnode->element); blob - 5a73d31b8247474c6ab200877bc8e63bbab051a9 blob + abd39987b3880bbfb3a757f18096b0ae91a4fd13 --- src/mh.c +++ src/mh.c @@ -1281,6 +1281,6 @@ static void mh_set_mtime(Folder *folder, FolderItem *i } item->mtime = s.st_mtime; - debug_print("MH: forced mtime of %s to %"CM_TIME_FORMAT"\n", item->name?item->name:"(null)", item->mtime); + debug_print("MH: forced mtime of %s to %lld\n", item->name?item->name:"(null)", item->mtime); g_free(path); }