Bug 227450

Summary: -Wunused-function warnings in KeywordLookup.h
Product: WebKit Reporter: Michael Catanzaro <mcatanzaro>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: mcatanzaro
Priority: P2    
Version: WebKit Nightly Build   
Hardware: PC   
OS: Linux   

Description Michael Catanzaro 2021-06-28 07:56:29 PDT
[5/491] Building CXX object Source/JavaScriptCore/CMakeFi...edSources/unified-sources/UnifiedSource-f2e18ffc-27.cpp.o
In file included from ../../Source/JavaScriptCore/runtime/LiteralParser.cpp:39,
                 from JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-f2e18ffc-27.cpp:5:
JavaScriptCore/DerivedSources/KeywordLookup.h:87:27: warning: ‘bool JSC::cannotBeIdentPartOrEscapeStart(LChar)’ declared ‘static’ but never defined [-Wunused-function]
   87 | static ALWAYS_INLINE bool cannotBeIdentPartOrEscapeStart(LChar);
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
JavaScriptCore/DerivedSources/KeywordLookup.h:88:27: warning: ‘bool JSC::cannotBeIdentPartOrEscapeStart(UChar)’ declared ‘static’ but never defined [-Wunused-function]
   88 | static ALWAYS_INLINE bool cannotBeIdentPartOrEscapeStart(UChar);
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This was introduced in r278971 "[JSC] Optimize JSON.parse with small data by changing Identifier pool mechanism." Problem is KeywordLookup.h does not define these functions and expects the translation unit that it is #included in to do so. Previously that was only Lexer.cpp. Problem is it's now also #included from LiteralParser.cpp, which does not define cannotBeIdentPartOrEscapeStart(LChar) or cannotBeIdentPartOrEscapeStart(UChar). We probably need to move the definitions of these functions to KeywordLookup.h, which is generated by KeywordLookupGenerator.py.
Comment 1 Michael Catanzaro 2021-06-28 07:58:15 PDT
Um, already reported.

*** This bug has been marked as a duplicate of bug 227436 ***