WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 189538
[Win][Clang][WebKitLegacy] Fix compilation errors and warnings of WebPreferences.cpp
https://bugs.webkit.org/show_bug.cgi?id=189538
Summary
[Win][Clang][WebKitLegacy] Fix compilation errors and warnings of WebPreferen...
Fujii Hironori
Reported
2018-09-11 23:38:19 PDT
[Win][Clang][WebKitLegacy] Fix compilation errors and warnings of WebPreferences.cpp While trying to build WebKit WinCairo port with the latest Clang (
Bug 171618
), the following compilation errors and warnings are reported.
> [8/31] Building CXX object Source\WebKitLegacy\CMakeFiles\WebKitLegacy.dir\win\WebPreferences.cpp.obj > FAILED: Source/WebKitLegacy/CMakeFiles/WebKitLegacy.dir/win/WebPreferences.cpp.obj > C:\tools\llvm\bin\clang-cl.exe (...) -c ..\..\Source\WebKitLegacy\win\WebPreferences.cpp > In file included from ..\..\Source\WebKitLegacy\win\WebPreferences.cpp:27: > ..\..\Source\WebKitLegacy\win/WebKitDLL.h(53,37): warning: 'gClassNameCount' has C-linkage specified, but returns user-defined type 'HashCountedSet<WTF::String> &' which is incompatible with C [-Wreturn-type-c-linkage] > extern HashCountedSet<WTF::String>& gClassNameCount(); > ^ > ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(518,26): error: cannot initialize a variable of type 'CFPropertyListFormat' with an rvalue of type 'long long' > CFPropertyListFormat format = kCFPropertyListBinaryFormat_v1_0 | kCFPropertyListXMLFormat_v1_0; > ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(1355,15): warning: initialization of pointer of type 'BOOL *' (aka 'int *') to null from a constant boolean expression [-Wbool-conversion] > enabled = false; > ^~~~~ > ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(83,9): error: no matching function for call to 'CFNumberGetValue' > CFNumberGetValue(static_cast<CFNumberRef>(value), CFNumberTraits<NumberType>::Type, &val); > ^~~~~~~~~~~~~~~~ > ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(98,12): note: in instantiation of function template specialization 'numberValueForPreferencesValue<int>' requested here > return numberValueForPreferencesValue<int>(value); > ^ > C:\webkit\ga\WebKitBuild\Debug\..\..\WebKitLibraries\win\include\CoreFoundation\CFNumber.h(133,9): note: candidate function not viable: no known conversion from 'const unsigned int' to 'CFNumberType' for 2nd argument > Boolean CFNumberGetValue(CFNumberRef number, CFNumberType theType, void *valuePtr); > ^ > ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(83,9): error: no matching function for call to 'CFNumberGetValue' > CFNumberGetValue(static_cast<CFNumberRef>(value), CFNumberTraits<NumberType>::Type, &val); > ^~~~~~~~~~~~~~~~ > ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(409,12): note: in instantiation of function template specialization 'numberValueForPreferencesValue<float>' requested here > return numberValueForPreferencesValue<float>(valueForKey(key).get()); > ^ > C:\webkit\ga\WebKitBuild\Debug\..\..\WebKitLibraries\win\include\CoreFoundation\CFNumber.h(133,9): note: candidate function not viable: no known conversion from 'const unsigned int' to 'CFNumberType' for 2nd argument > Boolean CFNumberGetValue(CFNumberRef number, CFNumberType theType, void *valuePtr); > ^ > ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(83,9): error: no matching function for call to 'CFNumberGetValue' > CFNumberGetValue(static_cast<CFNumberRef>(value), CFNumberTraits<NumberType>::Type, &val); > ^~~~~~~~~~~~~~~~ > ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(414,12): note: in instantiation of function template specialization 'numberValueForPreferencesValue<long long>' requested here > return numberValueForPreferencesValue<LONGLONG>(valueForKey(key).get()); > ^ > C:\webkit\ga\WebKitBuild\Debug\..\..\WebKitLibraries\win\include\CoreFoundation\CFNumber.h(133,9): note: candidate function not viable: no known conversion from 'const unsigned int' to 'CFNumberType' for 2nd argument > Boolean CFNumberGetValue(CFNumberRef number, CFNumberType theType, void *valuePtr); > ^ > ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(93,20): error: no matching function for call to 'CFNumberCreate' > return adoptCF(CFNumberCreate(0, CFNumberTraits<NumberType>::Type, &value)); > ^~~~~~~~~~~~~~ > ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(435,25): note: in instantiation of function template specialization 'cfNumber<int>' requested here > setValueForKey(key, cfNumber(value).get()); > ^ > C:\webkit\ga\WebKitBuild\Debug\..\..\WebKitLibraries\win\include\CoreFoundation\CFNumber.h(102,13): note: candidate function not viable: no known conversion from 'const unsigned int' to 'CFNumberType' for 2nd argument > CFNumberRef CFNumberCreate(CFAllocatorRef allocator, CFNumberType theType, const void *valuePtr); > ^ > ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(93,20): error: no matching function for call to 'CFNumberCreate' > return adoptCF(CFNumberCreate(0, CFNumberTraits<NumberType>::Type, &value)); > ^~~~~~~~~~~~~~ > ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(445,25): note: in instantiation of function template specialization 'cfNumber<float>' requested here > setValueForKey(key, cfNumber(value).get()); > ^ > C:\webkit\ga\WebKitBuild\Debug\..\..\WebKitLibraries\win\include\CoreFoundation\CFNumber.h(102,13): note: candidate function not viable: no known conversion from 'const unsigned int' to 'CFNumberType' for 2nd argument > CFNumberRef CFNumberCreate(CFAllocatorRef allocator, CFNumberType theType, const void *valuePtr); > ^ > ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(93,20): error: no matching function for call to 'CFNumberCreate' > return adoptCF(CFNumberCreate(0, CFNumberTraits<NumberType>::Type, &value)); > ^~~~~~~~~~~~~~ > ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(465,25): note: in instantiation of function template specialization 'cfNumber<long long>' requested here > setValueForKey(key, cfNumber(value).get()); > ^ > C:\webkit\ga\WebKitBuild\Debug\..\..\WebKitLibraries\win\include\CoreFoundation\CFNumber.h(102,13): note: candidate function not viable: no known conversion from 'const unsigned int' to 'CFNumberType' for 2nd argument > CFNumberRef CFNumberCreate(CFAllocatorRef allocator, CFNumberType theType, const void *valuePtr); > ^ > 2 warnings and 7 errors generated.
Attachments
Patch
(3.05 KB, patch)
2018-09-11 23:58 PDT
,
Fujii Hironori
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Fujii Hironori
Comment 1
2018-09-11 23:58:20 PDT
Created
attachment 349527
[details]
Patch
EWS Watchlist
Comment 2
2018-09-11 23:59:56 PDT
Attachment 349527
[details]
did not pass style-queue: ERROR: Source/WebKitLegacy/win/WebPreferences.cpp:64: More than one command on the same line [whitespace/newline] [4] ERROR: Source/WebKitLegacy/win/WebPreferences.cpp:65: More than one command on the same line [whitespace/newline] [4] ERROR: Source/WebKitLegacy/win/WebPreferences.cpp:66: More than one command on the same line [whitespace/newline] [4] ERROR: Source/WebKitLegacy/win/WebPreferences.cpp:67: More than one command on the same line [whitespace/newline] [4] Total errors found: 4 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Per Arne Vollan
Comment 3
2018-09-12 09:06:52 PDT
Comment on
attachment 349527
[details]
Patch R=me.
Fujii Hironori
Comment 4
2018-09-12 19:15:00 PDT
Comment on
attachment 349527
[details]
Patch Clearing flags on attachment: 349527 Committed
r235966
: <
https://trac.webkit.org/changeset/235966
>
Fujii Hironori
Comment 5
2018-09-12 19:15:03 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 6
2018-09-12 19:16:32 PDT
<
rdar://problem/44403488
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug