Add -Wc++-compat option, and eliminate corresponsing warnings #305
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Recently, Tcl 9.1 (still in development) started to include utf8proc for doing its Unicode character conversions. Since Tcl is normally built with the option -Wc++-compat, this produces a lot of compiler warnings.
This resulted in the following bug report to Tcl:
https://core.tcl-lang.org/tcl/tktview/9e4c412f64
The cause of this warnings are that in C++ any operation (like '|') on an enum (like utf8proc_option_t) converts the type to an integer, which then cannot be used as an enum. This can be handled by an additional typecast, converting the integer back to the expected utf8proc_option_t.
It's unfortunate that C++ operates this way, and clang 21 (among others) warns for this with the option -Wc++-compat
Those proposed changes eliminate the warnings, and add a -Wc++-compat option in the Makefile