Harfbuzz Overflow

I’m seeing the following issues in harfbuzz:

Linux GCC:

/home/runner/work/tracktion_engine/tracktion_engine/modules/juce/modules/juce_graphics/fonts/harfbuzz/OT/Var/VARC/../../../hb-open-type.hh: In static member function ‘static unsigned int OT::TupleValues::encode_value_run_as_longs(unsigned int&, hb_array_t<char>, hb_array_t<const int>)’:
/home/runner/work/tracktion_engine/tracktion_engine/modules/juce/modules/juce_graphics/fonts/harfbuzz/OT/Var/VARC/../../../hb-open-type.hh:1684:33: warning: overflow in conversion from ‘int’ to ‘char’ changes value from ‘255’ to ‘'\37777777777'’ [-Woverflow]
 1684 |       *it++ = (VALUES_ARE_LONGS | 63);
      |               ~~~~~~~~~~~~~~~~~~^~~~~

and on Xcode Apple Clang:

/Users/runner/work/tracktion_engine/tracktion_engine/modules/juce/modules/juce_graphics/fonts/harfbuzz/OT/Color/COLR/COLR.hh:1614:5: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
    default:return;
    ^
/Users/runner/work/tracktion_engine/tracktion_engine/modules/juce/modules/juce_graphics/fonts/harfbuzz/OT/Color/COLR/COLR.hh:1614:5: note: insert 'DISPATCH_FALLTHROUGH;' to silence this warning
    default:return;
    ^
    DISPATCH_FALLTHROUGH; 
/Users/runner/work/tracktion_engine/tracktion_engine/modules/juce/modules/juce_graphics/fonts/harfbuzz/OT/Color/COLR/COLR.hh:1614:5: note: insert 'break;' to avoid fall-through
    default:return;
    ^
    break; 
In file included from /Users/runner/work/tracktion_engine/tracktion_engine/modules/juce/modules/juce_graphics/juce_graphics_Harfbuzz.cpp:89:
In file included from /Users/runner/work/tracktion_engine/tracktion_engine/modules/juce/modules/juce_graphics/fonts/harfbuzz/harfbuzz.cc:27:
In file included from /Users/runner/work/tracktion_engine/tracktion_engine/modules/juce/modules/juce_graphics/fonts/harfbuzz/hb-ot-layout.cc:49:
/Users/runner/work/tracktion_engine/tracktion_engine/modules/juce/modules/juce_graphics/fonts/harfbuzz/hb-ot-layout-base-table.hh:186:5: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
    default:return;
    ^
/Users/runner/work/tracktion_engine/tracktion_engine/modules/juce/modules/juce_graphics/fonts/harfbuzz/hb-ot-layout-base-table.hh:186:5: note: insert 'DISPATCH_FALLTHROUGH;' to silence this warning
    default:return;
    ^
    DISPATCH_FALLTHROUGH; 
/Users/runner/work/tracktion_engine/tracktion_engine/modules/juce/modules/juce_graphics/fonts/harfbuzz/hb-ot-layout-base-table.hh:186:5: note: insert 'break;' to avoid fall-through
    default:return;
    ^
    break; 

You can probably add -Wimplicit-fallthrough to the ignored list but I’m not sure if the overflow is intended or not? Either way it’s UB and needs to be silenced.

Can I gently bump this?

This warning/error is failing our CI builds so we can’t run any of our tests.

Having the same issue: Harfbuzz GCC warning on develop

Thank you for reporting this, we’ll try to address this promptly.

1 Like

This seems to be still unchanged on the tip of harfbuzz master. For now suppressing the warning seems to be the best we can do.

1 Like

Great. Thanks for this, I agree.