Skip to content
Tcl Source Code View Ticket
Login

View Ticket

compiler warnings on trunk

Closed / Fixed9e4c412f64352c2ffb2f55fb666cc30aa8bd742fCreated 1 year agoUpdated 1 year ago
Descriptionplain2025-09-16 16:08:50
/home/dgp/fossil/tcl/utf8proc/utf8proc.c: In function ‘utf8proc_decompose_char’:
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:450:11: warning: enum conversion when passing argument 4 of ‘utf8proc_decompose_char’ is invalid in C++ [-Wc++-compat]
  450 |   options & ~(unsigned int)UTF8PROC_LUMP, last_boundclass)
      |   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:485:43: note: in expansion of macro ‘utf8proc_decompose_lump’
  485 |     if (category == UTF8PROC_CATEGORY_ZS) utf8proc_decompose_lump(0x0020);
      |                                           ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:452:37: note: expected ‘utf8proc_option_t’ but argument is of type ‘unsigned int’
  452 | UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char(utf8proc_int32_t uc, utf8proc_int32_t *dst, utf8proc_ssize_t bufsize, utf8proc_option_t options, int *last_boundclass) {
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:450:11: warning: enum conversion when passing argument 4 of ‘utf8proc_decompose_char’ is invalid in C++ [-Wc++-compat]
  450 |   options & ~(unsigned int)UTF8PROC_LUMP, last_boundclass)
      |   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:487:7: note: in expansion of macro ‘utf8proc_decompose_lump’
  487 |       utf8proc_decompose_lump(0x0027);
      |       ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:452:37: note: expected ‘utf8proc_option_t’ but argument is of type ‘unsigned int’
  452 | UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char(utf8proc_int32_t uc, utf8proc_int32_t *dst, utf8proc_ssize_t bufsize, utf8proc_option_t options, int *last_boundclass) {
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:450:11: warning: enum conversion when passing argument 4 of ‘utf8proc_decompose_char’ is invalid in C++ [-Wc++-compat]
  450 |   options & ~(unsigned int)UTF8PROC_LUMP, last_boundclass)
      |   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:489:7: note: in expansion of macro ‘utf8proc_decompose_lump’
  489 |       utf8proc_decompose_lump(0x002D);
      |       ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:452:37: note: expected ‘utf8proc_option_t’ but argument is of type ‘unsigned int’
  452 | UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char(utf8proc_int32_t uc, utf8proc_int32_t *dst, utf8proc_ssize_t bufsize, utf8proc_option_t options, int *last_boundclass) {
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:450:11: warning: enum conversion when passing argument 4 of ‘utf8proc_decompose_char’ is invalid in C++ [-Wc++-compat]
  450 |   options & ~(unsigned int)UTF8PROC_LUMP, last_boundclass)
      |   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:490:39: note: in expansion of macro ‘utf8proc_decompose_lump’
  490 |     if (uc == 0x2044 || uc == 0x2215) utf8proc_decompose_lump(0x002F);
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:452:37: note: expected ‘utf8proc_option_t’ but argument is of type ‘unsigned int’
  452 | UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char(utf8proc_int32_t uc, utf8proc_int32_t *dst, utf8proc_ssize_t bufsize, utf8proc_option_t options, int *last_boundclass) {
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:450:11: warning: enum conversion when passing argument 4 of ‘utf8proc_decompose_char’ is invalid in C++ [-Wc++-compat]
  450 |   options & ~(unsigned int)UTF8PROC_LUMP, last_boundclass)
      |   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:491:23: note: in expansion of macro ‘utf8proc_decompose_lump’
  491 |     if (uc == 0x2236) utf8proc_decompose_lump(0x003A);
      |                       ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:452:37: note: expected ‘utf8proc_option_t’ but argument is of type ‘unsigned int’
  452 | UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char(utf8proc_int32_t uc, utf8proc_int32_t *dst, utf8proc_ssize_t bufsize, utf8proc_option_t options, int *last_boundclass) {
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:450:11: warning: enum conversion when passing argument 4 of ‘utf8proc_decompose_char’ is invalid in C++ [-Wc++-compat]
  450 |   options & ~(unsigned int)UTF8PROC_LUMP, last_boundclass)
      |   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:493:7: note: in expansion of macro ‘utf8proc_decompose_lump’
  493 |       utf8proc_decompose_lump(0x003C);
      |       ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:452:37: note: expected ‘utf8proc_option_t’ but argument is of type ‘unsigned int’
  452 | UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char(utf8proc_int32_t uc, utf8proc_int32_t *dst, utf8proc_ssize_t bufsize, utf8proc_option_t options, int *last_boundclass) {
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:450:11: warning: enum conversion when passing argument 4 of ‘utf8proc_decompose_char’ is invalid in C++ [-Wc++-compat]
  450 |   options & ~(unsigned int)UTF8PROC_LUMP, last_boundclass)
      |   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:495:7: note: in expansion of macro ‘utf8proc_decompose_lump’
  495 |       utf8proc_decompose_lump(0x003E);
      |       ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:452:37: note: expected ‘utf8proc_option_t’ but argument is of type ‘unsigned int’
  452 | UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char(utf8proc_int32_t uc, utf8proc_int32_t *dst, utf8proc_ssize_t bufsize, utf8proc_option_t options, int *last_boundclass) {
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:450:11: warning: enum conversion when passing argument 4 of ‘utf8proc_decompose_char’ is invalid in C++ [-Wc++-compat]
  450 |   options & ~(unsigned int)UTF8PROC_LUMP, last_boundclass)
      |   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:496:23: note: in expansion of macro ‘utf8proc_decompose_lump’
  496 |     if (uc == 0x2216) utf8proc_decompose_lump(0x005C);
      |                       ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:452:37: note: expected ‘utf8proc_option_t’ but argument is of type ‘unsigned int’
  452 | UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char(utf8proc_int32_t uc, utf8proc_int32_t *dst, utf8proc_ssize_t bufsize, utf8proc_option_t options, int *last_boundclass) {
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:450:11: warning: enum conversion when passing argument 4 of ‘utf8proc_decompose_char’ is invalid in C++ [-Wc++-compat]
  450 |   options & ~(unsigned int)UTF8PROC_LUMP, last_boundclass)
      |   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:498:7: note: in expansion of macro ‘utf8proc_decompose_lump’
  498 |       utf8proc_decompose_lump(0x005E);
      |       ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:452:37: note: expected ‘utf8proc_option_t’ but argument is of type ‘unsigned int’
  452 | UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char(utf8proc_int32_t uc, utf8proc_int32_t *dst, utf8proc_ssize_t bufsize, utf8proc_option_t options, int *last_boundclass) {
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:450:11: warning: enum conversion when passing argument 4 of ‘utf8proc_decompose_char’ is invalid in C++ [-Wc++-compat]
  450 |   options & ~(unsigned int)UTF8PROC_LUMP, last_boundclass)
      |   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:500:7: note: in expansion of macro ‘utf8proc_decompose_lump’
  500 |       utf8proc_decompose_lump(0x005F);
      |       ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:452:37: note: expected ‘utf8proc_option_t’ but argument is of type ‘unsigned int’
  452 | UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char(utf8proc_int32_t uc, utf8proc_int32_t *dst, utf8proc_ssize_t bufsize, utf8proc_option_t options, int *last_boundclass) {
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:450:11: warning: enum conversion when passing argument 4 of ‘utf8proc_decompose_char’ is invalid in C++ [-Wc++-compat]
  450 |   options & ~(unsigned int)UTF8PROC_LUMP, last_boundclass)
      |   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:501:23: note: in expansion of macro ‘utf8proc_decompose_lump’
  501 |     if (uc == 0x02CB) utf8proc_decompose_lump(0x0060);
      |                       ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:452:37: note: expected ‘utf8proc_option_t’ but argument is of type ‘unsigned int’
  452 | UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char(utf8proc_int32_t uc, utf8proc_int32_t *dst, utf8proc_ssize_t bufsize, utf8proc_option_t options, int *last_boundclass) {
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:450:11: warning: enum conversion when passing argument 4 of ‘utf8proc_decompose_char’ is invalid in C++ [-Wc++-compat]
  450 |   options & ~(unsigned int)UTF8PROC_LUMP, last_boundclass)
      |   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:502:23: note: in expansion of macro ‘utf8proc_decompose_lump’
  502 |     if (uc == 0x2223) utf8proc_decompose_lump(0x007C);
      |                       ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:452:37: note: expected ‘utf8proc_option_t’ but argument is of type ‘unsigned int’
  452 | UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char(utf8proc_int32_t uc, utf8proc_int32_t *dst, utf8proc_ssize_t bufsize, utf8proc_option_t options, int *last_boundclass) {
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:450:11: warning: enum conversion when passing argument 4 of ‘utf8proc_decompose_char’ is invalid in C++ [-Wc++-compat]
  450 |   options & ~(unsigned int)UTF8PROC_LUMP, last_boundclass)
      |   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:503:23: note: in expansion of macro ‘utf8proc_decompose_lump’
  503 |     if (uc == 0x223C) utf8proc_decompose_lump(0x007E);
      |                       ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:452:37: note: expected ‘utf8proc_option_t’ but argument is of type ‘unsigned int’
  452 | UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char(utf8proc_int32_t uc, utf8proc_int32_t *dst, utf8proc_ssize_t bufsize, utf8proc_option_t options, int *last_boundclass) {
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:450:11: warning: enum conversion when passing argument 4 of ‘utf8proc_decompose_char’ is invalid in C++ [-Wc++-compat]
  450 |   options & ~(unsigned int)UTF8PROC_LUMP, last_boundclass)
      |   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:507:9: note: in expansion of macro ‘utf8proc_decompose_lump’
  507 |         utf8proc_decompose_lump(0x000A);
      |         ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:452:37: note: expected ‘utf8proc_option_t’ but argument is of type ‘unsigned int’
  452 | UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char(utf8proc_int32_t uc, utf8proc_int32_t *dst, utf8proc_ssize_t bufsize, utf8proc_option_t options, int *last_boundclass) {
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c: In function ‘utf8proc_NFD’:
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:793:33: warning: enum conversion when passing argument 4 of ‘utf8proc_map’ is invalid in C++ [-Wc++-compat]
  793 |   utf8proc_map(str, 0, &retval, UTF8PROC_NULLTERM | UTF8PROC_STABLE |
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  794 |     UTF8PROC_DECOMPOSE);
      |     ~~~~~~~~~~~~~~~~~~           
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:755:37: note: expected ‘utf8proc_option_t’ but argument is of type ‘int’
  755 | UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_map(
      |                                     ^~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c: In function ‘utf8proc_NFC’:
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:800:33: warning: enum conversion when passing argument 4 of ‘utf8proc_map’ is invalid in C++ [-Wc++-compat]
  800 |   utf8proc_map(str, 0, &retval, UTF8PROC_NULLTERM | UTF8PROC_STABLE |
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  801 |     UTF8PROC_COMPOSE);
      |     ~~~~~~~~~~~~~~~~             
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:755:37: note: expected ‘utf8proc_option_t’ but argument is of type ‘int’
  755 | UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_map(
      |                                     ^~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c: In function ‘utf8proc_NFKD’:
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:807:33: warning: enum conversion when passing argument 4 of ‘utf8proc_map’ is invalid in C++ [-Wc++-compat]
  807 |   utf8proc_map(str, 0, &retval, UTF8PROC_NULLTERM | UTF8PROC_STABLE |
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  808 |     UTF8PROC_DECOMPOSE | UTF8PROC_COMPAT);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:755:37: note: expected ‘utf8proc_option_t’ but argument is of type ‘int’
  755 | UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_map(
      |                                     ^~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c: In function ‘utf8proc_NFKC’:
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:814:33: warning: enum conversion when passing argument 4 of ‘utf8proc_map’ is invalid in C++ [-Wc++-compat]
  814 |   utf8proc_map(str, 0, &retval, UTF8PROC_NULLTERM | UTF8PROC_STABLE |
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  815 |     UTF8PROC_COMPOSE | UTF8PROC_COMPAT);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:755:37: note: expected ‘utf8proc_option_t’ but argument is of type ‘int’
  755 | UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_map(
      |                                     ^~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c: In function ‘utf8proc_NFKC_Casefold’:
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:821:33: warning: enum conversion when passing argument 4 of ‘utf8proc_map’ is invalid in C++ [-Wc++-compat]
  821 |   utf8proc_map(str, 0, &retval, UTF8PROC_NULLTERM | UTF8PROC_STABLE |
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  822 |     UTF8PROC_COMPOSE | UTF8PROC_COMPAT | UTF8PROC_CASEFOLD | UTF8PROC_IGNORE);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dgp/fossil/tcl/utf8proc/utf8proc.c:755:37: note: expected ‘utf8proc_option_t’ but argument is of type ‘int’
  755 | UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_map(
      |                                     ^~~~~~~~~~~~
apnadkarniplain2025-09-16 16:46:17
Caused by the Unicode 17 update overwriting prior patch. Fixed now.

Alternative would be disable the -Wc++-compat for utf8proc.c else we have to apply the patch on every update. Not sure which is preferable.
apnadkarniplain2025-09-16 16:47:38
A general note on use of enums - C++ and C treatment of enums is not the same in the latest standards.
jan.nijtmanswiki2025-09-16 20:14:30

This problem should be correctedin utf8proc.c, not in utf8proc.h. But .... that would be a lot more patching of an externally-provided source file. Which is bad!

So, I agree with Ashok's solution here.

Thanks! I was not aware that utf8proc.h was modified.

jan.nijtmanswiki2025-10-02 15:50:17

Pull-request for upstream utf8proc created.

jan.nijtmanswiki2025-10-12 20:13:19

Since the Pull-request was accepted upstream. Replaced Ashok's solution with this one.

This means, starting with the next utf8proc version we no longer have to hand-edit any file any more. Just copy the files as-is.

Log in (anonymous is fine) to add a comment.