You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Clang warning of type -Wsizeof-array-div for arabic fallback shaping static assert #1969
[1993/73487] CXX win_clang_nacl_win64/obj/third_party/harfbuzz-ng/harfbuzz_source/hb-ot-shape-complex-arabic.obj
In file included from ../../third_party/harfbuzz-ng/src/src/hb-ot-shape-complex-arabic.cc:245:
../../third_party/harfbuzz-ng/src/src/hb-ot-shape-complex-arabic-fallback.hh(233,68): warning: expression does not compute the number of elements in this array; element type is 'const unsigned char', not 'ManifestLookup' [-Wsizeof-array-div]
static_assert (sizeof (arabic_win1256_gsub_lookups.manifestData) / sizeof ()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
1 warning generated.
From a cursory inspection, this looks like it could be a true positive.
MANIFEST starts with OT_LABEL_START which places a unsigned char Name[
I would say just disable this platform specific encoding by HB_NO_WIN1256, it is for .fon font files(!) which Chrome doesn't support anyway (see f28b1c8, it needs Uniscribe's platform specific cmap callback, which Chrome doesn't have) and is intended for Firefox, I will turn it on our clang -Weverything CI bot and once we get that clang update on the bot (which uses very experimental clang also) we will fix that as well but you just don't need that.
Do you have more info on what Clang fails to find here, and for that purpose could you dissect how the assert is correct? Perhaps we can file a Clang bug.
CC @nico
Do you have more info on what Clang fails to find here, and for that purpose could you dissect how the assert is correct? Perhaps we can file a Clang bug.
We're asserting that sizeof(backing byte-array) / sizeof(struct) >= number of elements. That's correct calculation. clang is just saying that it looks like we were trying to calculate the number of element in a C array. We are not doing that here.
Activity
ebraminio commentedon Sep 21, 2019
I would say just disable this platform specific encoding by HB_NO_WIN1256, it is for .fon font files(!) which Chrome doesn't support anyway (see f28b1c8, it needs Uniscribe's platform specific cmap callback, which Chrome doesn't have) and is intended for Firefox, I will turn it on our clang -Weverything CI bot and once we get that clang update on the bot (which uses very experimental clang also) we will fix that as well but you just don't need that.
[ci] Enable HB_WITH_WIN1256 on -Weverything bot
drott commentedon Sep 23, 2019
Thanks for the suggestion, @ebraminio! Incorporated in https://chromium-review.googlesource.com/c/chromium/src/+/1819176
behdad commentedon Sep 30, 2019
There is no bug. The warning is a false-positive. I'm not sure how to best ignore it. Can remove assertion but don't see why either.
drott commentedon Oct 1, 2019
Do you have more info on what Clang fails to find here, and for that purpose could you dissect how the assert is correct? Perhaps we can file a Clang bug.
CC @nico
drott commentedon Oct 1, 2019
Thanks, @ebraminio, good idea.
behdad commentedon Oct 7, 2019
We're asserting that sizeof(backing byte-array) / sizeof(struct) >= number of elements. That's correct calculation. clang is just saying that it looks like we were trying to calculate the number of element in a C array. We are not doing that here.
ebraminio commentedon Oct 7, 2019
Will be fixed by https://reviews.llvm.org/D68526 apparently
behdad commentedon Oct 8, 2019
Sounds right to me.