head 1.2; access; symbols; locks; strict; comment @ * @; 1.2 date 2026.07.10.23.32.37; author tsutsui; state Exp; branches; next 1.1; commitid XXwM2i2aAbK8faNG; 1.1 date 2026.06.28.06.16.28; author tsutsui; state Exp; branches; next ; commitid J1Yf621yszsDTwLG; desc @@ 1.2 log @ja-freewnn-*: make FreeWnn-1.1.1-a023 builds with gcc 15 - various fixes to use proper function prototypes for C23 - use proper function types for signal handlers - use proper variadic arguments to print messages using printf formats - fix test programs in configure.in and regen configure using autoconf 2.72 for modern C23 compilers - appease more several warnings - also apply fixes to build FreeWnn on recent Linux distributions: - set LC_ALL=C before egrep(1) against EUC files to avoid unexpected errors for EUC files - use _DEFAULT_SOURCE for Linux rather than obsolete _BSD_SOURCE for newer glibc - update several patch comments properly to clarify each fix - gcc 14 enables -Werror=incompatible-pointer-types by default but still uses -std=gnu17 by default - gcc 15 has switched to -std=gnu23 by default so that old K&R style function declarations ("no argument" is treated as "void") cause more incompatible-pointer-types and too-many-arguments errors - remove patches against sources under Xwnmo that seems unmaintained (no configure settings) and not enabled by the default builds Bump PKGREVISIONs. @ text @$NetBSD: patch-Wnn_jutil_atof.c,v 1.1 2026/06/28 06:16:28 tsutsui Exp $ - Appease -Wincompatible-pointer-types that are fatal on gcc14 and later - Remove unnecessary old style function declarations - Use proper variadic arguments to print error messages --- Wnn/jutil/atof.c.orig 2013-09-02 11:01:39.000000000 +0000 +++ Wnn/jutil/atof.c @@@@ -121,6 +121,7 @@@@ static char *rcs_id = "$Id: atof.c,v 1.8 # include # endif #endif /* STDC_HEADERS */ +#include #if HAVE_UNISTD_H # include #endif @@@@ -289,15 +290,17 @@@@ static void set_id FRWNN_PARAMS((int, in static void pre_clear_jiritugo_v FRWNN_PARAMS((int)); static void init FRWNN_PARAMS((int, char **)); -extern int wnn_loadhinsi (), create_file_header (); - static void -error_format (s, d1, d2, d3, d4, d5) - char *s; - int d1, d2, d3, d4, d5; +error_format (const char *fmt, ...) { + va_list ap; + fprintf (stderr, "Bad format near line %d \"%s\".\n", line_no, buf); - fprintf (stderr, s, d1, d2, d3, d4, d5); + + va_start (ap, fmt); + vfprintf (stderr, fmt, ap); + va_end (ap); + exit (1); } @@@@ -522,8 +525,6 @@@@ read_attr () } } -extern char *wnn_get_hinsi_name (); - static void read_id () { @@@@ -596,15 +597,18 @@@@ read_id () static int sort_func_id (a, b) - char *a, *b; + const void *a, *b; { - return (strcmp (((struct id_struct *) a)->str, ((struct id_struct *) b)->str)); + const struct id_struct *ia = a; + const struct id_struct *ib = b; + + return (strcmp (ia->str, ib->str)); } static void sort_id () { - qsort ((char *) &id[0], id_num, sizeof (struct id_struct), sort_func_id); + qsort (&id[0], id_num, sizeof (struct id_struct), sort_func_id); } #ifdef nodef @@@@ -741,17 +745,20 @@@@ bsch (c, st, end) #ifndef NO_FZK static int sort_func_fz (a, b) - char *a, *b; + const void *a, *b; { int c; + /* XXX may cause -Wcast-qual but wnn_Strcmp() should be fixed to take const */ + struct fuzokugo *fa = (struct fuzokugo *)a; + struct fuzokugo *fb = (struct fuzokugo *)b; - if ((c = wnn_Strcmp (((struct fuzokugo *) a)->y, ((struct fuzokugo *) b)->y)) == 0) + if ((c = wnn_Strcmp (fa->y, fb->y)) == 0) { - if (((struct fuzokugo *) a)->hinsi > ((struct fuzokugo *) b)->hinsi) + if (fa->hinsi > fb->hinsi) { return (1); } - else if (((struct fuzokugo *) a)->hinsi < ((struct fuzokugo *) b)->hinsi) + else if (fa->hinsi < fb->hinsi) { return (-1); } @@@@ -763,7 +770,7 @@@@ sort_func_fz (a, b) static void sort () { - qsort ((char *) &fz[0], fz_num, sizeof (struct fuzokugo), sort_func_fz); + qsort (&fz[0], fz_num, sizeof (struct fuzokugo), sort_func_fz); } #endif /* NO_FZK */ @ 1.1 log @ja-freewnn-{lib,server}: fix builds with gcc 14 and later - Add necessary standard headers to pull proper prototypes in test programs in the generated configure script to avoid errors caused by -Wimplicit-function-declaration (which is fatal on -std=gnu23) - Use proper qsort(3)-compatible comparator prototypes - Add missing prototypes for several function pointer arguments - Fix other -Wimcompatiple-pointer-types warnings - Appease several -Wpointer-compare and -Wpointer-sign warnings - Move -Wchar-subscripts fixes from SUBST to explicit patch files - Also fix wnn_sStrncpy() to use the correct conversion direction (found during -Wincompatiple-pointer-types cleanup) While here, take MAINTAINERship. Bump PKGREVISIONs. @ text @d1 1 a1 1 $NetBSD$ d3 3 a5 1 - Fix build with -std=gnu23 (i.e. gcc14 and later) d9 42 a50 1 @@@@ -596,15 +596,18 @@@@ read_id () d72 1 a72 1 @@@@ -741,17 +744,20 @@@@ bsch (c, st, end) d97 1 a97 1 @@@@ -763,7 +769,7 @@@@ sort_func_fz (a, b) @