Created attachment 367910 [details] webkit-schar.patch Building WebKitGtk+ 2.24.0 on FreeBSD/aarch64 (13-CURRENT) results in signed char warnings (that get turned into errors by Werror): http://thunderx1.nyi.freebsd.org/data/head-arm64-default/p498440_s346039/logs/errors/webkit2-gtk3-2.24.0_1.log /wrkdirs/usr/ports/www/webkit2-gtk3/work/webkitgtk-2.24.0/Source/WebCore/contentextensions/DFACombiner.cpp:109:52: error: non-constant-expression cannot be narrowed from type 'char' to 'signed char' in initializer list [-Wc++11-narrowing] m_output.transitionRanges.append({ range.first, range.last }); ^~~~~~~~~~~ /wrkdirs/usr/ports/www/webkit2-gtk3/work/webkitgtk-2.24.0/Source/WebCore/contentextensions/DFACombiner.cpp:109:52: note: insert an explicit cast to silence this issue m_output.transitionRanges.append({ range.first, range.last }); ^~~~~~~~~~~ static_cast<signed char>( ) /wrkdirs/usr/ports/www/webkit2-gtk3/work/webkitgtk-2.24.0/Source/WebCore/contentextensions/DFACombiner.cpp:109:65: error: non-constant-expression cannot be narrowed from type 'char' to 'signed char' in initializer list [-Wc++11-narrowing] m_output.transitionRanges.append({ range.first, range.last }); ^~~~~~~~~~ /wrkdirs/usr/ports/www/webkit2-gtk3/work/webkitgtk-2.24.0/Source/WebCore/contentextensions/DFACombiner.cpp:109:65: note: insert an explicit cast to silence this issue m_output.transitionRanges.append({ range.first, range.last }); ^~~~~~~~~~ static_cast<signed char>( ) The attached patch fixes this by using signed chars in the types of the 'range' objects.
Comment on attachment 367910 [details] webkit-schar.patch View in context: https://bugs.webkit.org/attachment.cgi?id=367910&action=review > Source/WebCore/contentextensions/DFACombiner.cpp:40 > + typedef MutableRangeList<signed char, uint64_t, 128> CombinedTransitionsMutableRangeList; WebKit coding style is to use one word (signed/unsigned, not signed char/unsigned char). I don't know if we necessarily want to fix this warning in code, it looks overly pedantic. But to have this discussed, it will be useful to formally post it for review (with a ChangeLog, and marked r?). Would you be willing to do that?
Comment on attachment 367910 [details] webkit-schar.patch View in context: https://bugs.webkit.org/attachment.cgi?id=367910&action=review >> Source/WebCore/contentextensions/DFACombiner.cpp:40 >> + typedef MutableRangeList<signed char, uint64_t, 128> CombinedTransitionsMutableRangeList; > > WebKit coding style is to use one word (signed/unsigned, not signed char/unsigned char). > > I don't know if we necessarily want to fix this warning in code, it looks overly pedantic. But to have this discussed, it will be useful to formally post it for review (with a ChangeLog, and marked r?). Would you be willing to do that? This is true with things like integers, but chars are a mess. They're usually unsigned on linux and signed most other places but not all. This needs the signed keyword to be portable. If you request review and commit, I'll do both.
You'll also need a ChangeLog entry. Running Tools/Scripts/prepare-ChangeLog will give you a template to fill in.
Yeah, I agree this change is correct. signed or unsigned on its own would be signed int or unsigned int, not what's needed here. Remember signed char is a separate type from char (unlike all other signed types).
Created attachment 368036 [details] webkit-schar.patch v2 added changelog entry
Comment on attachment 368036 [details] webkit-schar.patch v2 See https://github.com/llvm/llvm-project/blob/master/lldb/source/Utility/ArchSpec.cpp#L763 for why this kind of thing is necessary :/
Comment on attachment 368036 [details] webkit-schar.patch v2 Clearing flags on attachment: 368036 Committed r244591: <https://trac.webkit.org/changeset/244591>
All reviewed patches have been landed. Closing bug.
<rdar://problem/50169088>