clang also gives this warning:

unictype/categ_none.c:30:13: warning: initializing 'const void *' with an 
expression of type 'bool (*)(ucs4_t, uint32_t)' (aka 'bool (*)(unsigned int, 
unsigned int)') converts between void pointer and function pointer [-Wpedantic]

The problem is the initializer of a 'union' field that is not the first field.
Fortunately, ISO C designated initializers are nowadays widely usable.


2023-09-07  Bruno Haible  <[email protected]>

        unictype/category-none: Fix clang -Wpedantic warning.
        * lib/unictype/categ_none.c (_UC_CATEGORY_NONE): Use ISO C designated
        initializer syntax to initialize the intended field of the union.

diff --git a/lib/unictype/categ_none.c b/lib/unictype/categ_none.c
index 89f4949333..43ae957aa2 100644
--- a/lib/unictype/categ_none.c
+++ b/lib/unictype/categ_none.c
@@ -27,4 +27,4 @@ always_false (ucs4_t uc, uint32_t bitmask)
 }
 
 const uc_general_category_t _UC_CATEGORY_NONE =
-  { 0, 1, { &always_false } };
+  { 0, 1, { .lookup_fn = &always_false } };




Reply via email to