JDK-8161699 : Fix compilation warnings in WebCore and JavaScriptCore
  • Type: Bug
  • Component: javafx
  • Sub-Component: web
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-07-19
  • Updated: 2016-07-24
  • Resolved: 2016-07-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u112Fixed 9Fixed
Description
While compiling in windows, observed two warnings in webkit  which should be fixed:

1. 
\rt\modules\web\src\main\native\source\javascriptcore\runtime\regexpprototype.cpp(148): warning C4700: uninitialized local variable 'string' used 

The fix will be taken from the changeset https://trac.webkit.org/changeset/200338

This changeset contains many warning fixes. But i will be taking now the fix only for file  RegExpPrototype.cpp (https://trac.webkit.org/changeset/200338/trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp). When i encounter more warnings, i can take more fixes if required.

2.  \rt\modules\web\src\main\native\Source\WebCore\platform\java\api\BackForwardListJava.cpp(72): warning C4190: 'createEntry' has C-linkage specified, but returns UDT 'JLocalRef<jobject>' which is incompatible with C [\rt\modules\web\build\win\Release\Source\WebCore\WebCore.vcxproj]
Comments
Changeset: 52afbf678d91 Author: mbilla Date: 2016-07-22 16:45 +0530 URL: http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/52afbf678d91
22-07-2016

lgtm
22-07-2016

Looks good. +1
21-07-2016

webrev: http://cr.openjdk.java.net/~mbilla/8161699/webrev.01/ Also I moved the non exported functions getSize, itemAtIndex out of extern "C" linkage. Compiled on windows and linux.
20-07-2016

Put extern "C" only to the functions which are exported across shared library.
20-07-2016

[~arajkumar] If i keep extern 'C" as per your suggestion, im getting below error for other non-exported functions like void notifyHistoryItemDestroyed(const JLObject &host) which is getting referenced from WebCore HistoryItem.cpp HistoryItem.obj : error LNK2019: unresolved external symbol notifyHistoryItemDestroyed referenced in function "public: __cdecl WebCore::HistoryItem::~HistoryItem(void)" (??1HistoryItem@WebCore@@QEAA@XZ) [D:\latest_windows_env\rt\modules\web\build\win\Release\Source\WebCore\WebCore.vcxproj] In HistoryItem.cpp, notifyHistoryItemDestroyed declared as extern C linkage. #if PLATFORM(JAVA) extern "C" { extern void notifyHistoryItemDestroyed(const JLObject&); } #endif
20-07-2016

webrev: http://cr.openjdk.java.net/~mbilla/8161699/webrev.00/ Regarding 2nd warning , i addressed only the particular warning by keeping 'createEntry' out of extern C linkage (since it is internal function and not exported). i did not keep other internal functions like "notifyHistoryItemChangedImpl" as there are no warnings as of now. Also for 2nd warning, i tested the fix with logs to make sure that backforward functionality is intact.
19-07-2016