diff --git a/src/node_i18n.cc b/src/node_i18n.cc index 282575b3c3cc5d..bab06cfcdfc41a 100644 --- a/src/node_i18n.cc +++ b/src/node_i18n.cc @@ -586,7 +586,9 @@ static void GetStringWidth(const FunctionCallbackInfo& args) { TwoByteValue value(env->isolate(), args[0]); // reinterpret_cast is required by windows to compile UChar* str = reinterpret_cast(*value); - UChar32 c; + static_assert(sizeof(*str) == sizeof(**value), + "sizeof(*str) == sizeof(**value)"); + UChar32 c = 0; UChar32 p; size_t n = 0; uint32_t width = 0;