WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
177895
Re-enable -Wcast-qual in WebCore for Apple ports
https://bugs.webkit.org/show_bug.cgi?id=177895
Summary
Re-enable -Wcast-qual in WebCore for Apple ports
David Kilzer (:ddkilzer)
Reported
2017-10-04 13:07:17 PDT
For
Bug 177893
, we disabled -Wcast-qual in WebCore for Apple ports. This bug tracks re-enabling it by introducing a safe (and readable) way to cast const CFTypeRef pointers to non-const CFTypeRef pointers (sometimes of a different type).
Attachments
Patch v1
(40.63 KB, patch)
2017-12-31 19:10 PST
,
David Kilzer (:ddkilzer)
no flags
Details
Formatted Diff
Diff
Patch v2
(40.75 KB, patch)
2017-12-31 19:16 PST
,
David Kilzer (:ddkilzer)
no flags
Details
Formatted Diff
Diff
Patch v3
(40.78 KB, patch)
2017-12-31 19:34 PST
,
David Kilzer (:ddkilzer)
no flags
Details
Formatted Diff
Diff
Patch v4
(40.73 KB, patch)
2017-12-31 20:30 PST
,
David Kilzer (:ddkilzer)
no flags
Details
Formatted Diff
Diff
Patch v5
(40.93 KB, patch)
2018-01-01 03:12 PST
,
David Kilzer (:ddkilzer)
no flags
Details
Formatted Diff
Diff
Patch v6
(40.99 KB, patch)
2018-01-01 03:21 PST
,
David Kilzer (:ddkilzer)
no flags
Details
Formatted Diff
Diff
Patch v7
(40.99 KB, patch)
2018-01-01 03:58 PST
,
David Kilzer (:ddkilzer)
no flags
Details
Formatted Diff
Diff
Patch v8
(41.73 KB, patch)
2018-01-01 09:58 PST
,
David Kilzer (:ddkilzer)
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews104 for mac-elcapitan-wk2
(2.61 MB, application/zip)
2018-01-01 11:20 PST
,
EWS Watchlist
no flags
Details
Patch v9
(41.29 KB, patch)
2018-01-01 18:21 PST
,
David Kilzer (:ddkilzer)
no flags
Details
Formatted Diff
Diff
Patch v10
(41.25 KB, patch)
2018-01-01 20:03 PST
,
David Kilzer (:ddkilzer)
no flags
Details
Formatted Diff
Diff
Patch v11
(41.10 KB, patch)
2018-01-01 22:44 PST
,
David Kilzer (:ddkilzer)
no flags
Details
Formatted Diff
Diff
Patch v12
(48.09 KB, patch)
2018-01-02 21:53 PST
,
David Kilzer (:ddkilzer)
no flags
Details
Formatted Diff
Diff
Patch v13
(41.42 KB, patch)
2018-01-03 09:35 PST
,
David Kilzer (:ddkilzer)
no flags
Details
Formatted Diff
Diff
Patch v14
(43.06 KB, patch)
2018-01-05 13:23 PST
,
David Kilzer (:ddkilzer)
no flags
Details
Formatted Diff
Diff
Show Obsolete
(13)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2017-10-12 12:38:29 PDT
<
rdar://problem/34960830
>
David Kilzer (:ddkilzer)
Comment 2
2017-12-31 19:10:53 PST
Created
attachment 330270
[details]
Patch v1
EWS Watchlist
Comment 3
2017-12-31 19:13:17 PST
Attachment 330270
[details]
did not pass style-queue: ERROR: Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:32: Alphabetical sorting problem. [build/include_order] [4] ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:59: Please replace ASSERT_WITH_SECURITY_IMPLICATION() with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(). [security/assertion] [5] ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:106: dynamic_id_cast is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:107: dynamic_id_cast is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 4 in 21 files If any of these errors are false positives, please file a bug against check-webkit-style.
David Kilzer (:ddkilzer)
Comment 4
2017-12-31 19:16:12 PST
Created
attachment 330271
[details]
Patch v2
EWS Watchlist
Comment 5
2017-12-31 19:18:35 PST
Attachment 330271
[details]
did not pass style-queue: ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:59: Please replace ASSERT_WITH_SECURITY_IMPLICATION() with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(). [security/assertion] [5] ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:106: dynamic_id_cast is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:107: dynamic_id_cast is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 3 in 21 files If any of these errors are false positives, please file a bug against check-webkit-style.
David Kilzer (:ddkilzer)
Comment 6
2017-12-31 19:34:42 PST
Created
attachment 330273
[details]
Patch v3
EWS Watchlist
Comment 7
2017-12-31 19:36:34 PST
Attachment 330273
[details]
did not pass style-queue: ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:59: Please replace ASSERT_WITH_SECURITY_IMPLICATION() with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(). [security/assertion] [5] ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:106: dynamic_id_cast is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:107: dynamic_id_cast is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 3 in 21 files If any of these errors are false positives, please file a bug against check-webkit-style.
David Kilzer (:ddkilzer)
Comment 8
2017-12-31 20:30:27 PST
Created
attachment 330276
[details]
Patch v4
EWS Watchlist
Comment 9
2017-12-31 20:33:06 PST
Attachment 330276
[details]
did not pass style-queue: ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:59: Please replace ASSERT_WITH_SECURITY_IMPLICATION() with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(). [security/assertion] [5] ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:106: dynamic_id_cast is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:107: dynamic_id_cast is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 3 in 21 files If any of these errors are false positives, please file a bug against check-webkit-style.
David Kilzer (:ddkilzer)
Comment 10
2018-01-01 03:12:48 PST
Created
attachment 330282
[details]
Patch v5
EWS Watchlist
Comment 11
2018-01-01 03:15:33 PST
Attachment 330282
[details]
did not pass style-queue: ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:59: Please replace ASSERT_WITH_SECURITY_IMPLICATION() with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(). [security/assertion] [5] ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:106: dynamic_id_cast is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:107: dynamic_id_cast is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 3 in 21 files If any of these errors are false positives, please file a bug against check-webkit-style.
David Kilzer (:ddkilzer)
Comment 12
2018-01-01 03:21:32 PST
Created
attachment 330283
[details]
Patch v6
EWS Watchlist
Comment 13
2018-01-01 03:24:37 PST
Attachment 330283
[details]
did not pass style-queue: ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:63: Please replace ASSERT_WITH_SECURITY_IMPLICATION() with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(). [security/assertion] [5] ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:110: dynamic_id_cast is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:111: dynamic_id_cast is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 3 in 21 files If any of these errors are false positives, please file a bug against check-webkit-style.
David Kilzer (:ddkilzer)
Comment 14
2018-01-01 03:58:29 PST
Created
attachment 330284
[details]
Patch v7
EWS Watchlist
Comment 15
2018-01-01 04:02:14 PST
Attachment 330284
[details]
did not pass style-queue: ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:63: Please replace ASSERT_WITH_SECURITY_IMPLICATION() with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(). [security/assertion] [5] ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:110: dynamic_id_cast is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:111: dynamic_id_cast is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 3 in 21 files If any of these errors are false positives, please file a bug against check-webkit-style.
David Kilzer (:ddkilzer)
Comment 16
2018-01-01 09:58:53 PST
Created
attachment 330286
[details]
Patch v8
EWS Watchlist
Comment 17
2018-01-01 10:01:53 PST
Attachment 330286
[details]
did not pass style-queue: ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:63: Please replace ASSERT_WITH_SECURITY_IMPLICATION() with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(). [security/assertion] [5] ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:110: dynamic_id_cast is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:111: dynamic_id_cast is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 3 in 21 files If any of these errors are false positives, please file a bug against check-webkit-style.
EWS Watchlist
Comment 18
2018-01-01 11:20:48 PST
Comment on
attachment 330286
[details]
Patch v8
Attachment 330286
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.webkit.org/results/5885909
New failing tests: fast/mediastream/MediaStream-MediaElement-setObject-null.html
EWS Watchlist
Comment 19
2018-01-01 11:20:49 PST
Created
attachment 330292
[details]
Archive of layout-test-results from ews104 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
David Kilzer (:ddkilzer)
Comment 20
2018-01-01 18:21:12 PST
Created
attachment 330304
[details]
Patch v9
EWS Watchlist
Comment 21
2018-01-01 18:23:40 PST
Attachment 330304
[details]
did not pass style-queue: ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:59: Please replace ASSERT_WITH_SECURITY_IMPLICATION() with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(). [security/assertion] [5] Total errors found: 1 in 21 files If any of these errors are false positives, please file a bug against check-webkit-style.
David Kilzer (:ddkilzer)
Comment 22
2018-01-01 20:03:08 PST
Created
attachment 330306
[details]
Patch v10
EWS Watchlist
Comment 23
2018-01-01 20:05:54 PST
Attachment 330306
[details]
did not pass style-queue: ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:59: Please replace ASSERT_WITH_SECURITY_IMPLICATION() with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(). [security/assertion] [5] Total errors found: 1 in 21 files If any of these errors are false positives, please file a bug against check-webkit-style.
David Kilzer (:ddkilzer)
Comment 24
2018-01-01 22:44:34 PST
Created
attachment 330309
[details]
Patch v11
EWS Watchlist
Comment 25
2018-01-01 22:47:16 PST
Attachment 330309
[details]
did not pass style-queue: ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:59: Please replace ASSERT_WITH_SECURITY_IMPLICATION() with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(). [security/assertion] [5] Total errors found: 1 in 21 files If any of these errors are false positives, please file a bug against check-webkit-style.
David Kilzer (:ddkilzer)
Comment 26
2018-01-02 11:16:01 PST
Comment on
attachment 330309
[details]
Patch v11 View in context:
https://bugs.webkit.org/attachment.cgi?id=330309&action=review
> Source/WTF/ChangeLog:40 > + (WTF::checked_cf_const_cast): This behaves the same way as > + WTF::checked_cf_cast does now, but works with CFTypes that are > + not defined as const pointers, including CFMutable types and > + other CFTypes defined outside of CoreFoundation.framework. We > + also add built-in support for CFMutable types in the header by > + defining traits for them.
Note that I added WTF::checked_cf_const_cast<> so that non-const CFTypes (the CFMutable* types) had a separate method to use. This makes it harder (in theory) to incorrectly cast to CFArray from CFMutableArray since you must use checked_cf_cast<CFArrayRef>() and checked_cf_const_cast<CFMutableArrayRef>(). In practice, I'm not sure how much this difference matters. I can just add the const_cast<CF_BRIDGED_TYPE(ID) void*>() to WTF::checked_cf_cast<> and the compiler wouldn't complain about the 'const' being removed and then re-added.
David Kilzer (:ddkilzer)
Comment 27
2018-01-02 11:40:43 PST
(In reply to David Kilzer (:ddkilzer) from
comment #26
)
> Comment on
attachment 330309
[details]
> Patch v11 > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=330309&action=review
> > > Source/WTF/ChangeLog:40 > > + (WTF::checked_cf_const_cast): This behaves the same way as > > + WTF::checked_cf_cast does now, but works with CFTypes that are > > + not defined as const pointers, including CFMutable types and > > + other CFTypes defined outside of CoreFoundation.framework. We > > + also add built-in support for CFMutable types in the header by > > + defining traits for them. > > Note that I added WTF::checked_cf_const_cast<> so that non-const CFTypes > (the CFMutable* types) had a separate method to use. > > This makes it harder (in theory) to incorrectly cast to CFArray from > CFMutableArray since you must use checked_cf_cast<CFArrayRef>() and > checked_cf_const_cast<CFMutableArrayRef>(). > > In practice, I'm not sure how much this difference matters. I can just add > the const_cast<CF_BRIDGED_TYPE(ID) void*>() to WTF::checked_cf_cast<> and > the compiler wouldn't complain about the 'const' being removed and then > re-added.
And I can check that CFMutable* objects are actually mutable using something like this (which would be a Debug assertion to start with since there is no security implication): inline bool CFArrayIsMutable(CFArrayRef array) { return [(id)array isMemberOfClass:[NSMutableArray class]]; }
David Kilzer (:ddkilzer)
Comment 28
2018-01-02 21:53:11 PST
Created
attachment 330366
[details]
Patch v12
EWS Watchlist
Comment 29
2018-01-02 21:55:51 PST
Attachment 330366
[details]
did not pass style-queue: ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:84: Please replace ASSERT_WITH_SECURITY_IMPLICATION() with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(). [security/assertion] [5] Total errors found: 1 in 23 files If any of these errors are false positives, please file a bug against check-webkit-style.
David Kilzer (:ddkilzer)
Comment 30
2018-01-02 21:56:30 PST
(In reply to David Kilzer (:ddkilzer) from
comment #27
)
> (In reply to David Kilzer (:ddkilzer) from
comment #26
) > > Comment on
attachment 330309
[details]
> > Patch v11 > > > > View in context: > >
https://bugs.webkit.org/attachment.cgi?id=330309&action=review
> > > > > Source/WTF/ChangeLog:40 > > > + (WTF::checked_cf_const_cast): This behaves the same way as > > > + WTF::checked_cf_cast does now, but works with CFTypes that are > > > + not defined as const pointers, including CFMutable types and > > > + other CFTypes defined outside of CoreFoundation.framework. We > > > + also add built-in support for CFMutable types in the header by > > > + defining traits for them. > > > > Note that I added WTF::checked_cf_const_cast<> so that non-const CFTypes > > (the CFMutable* types) had a separate method to use. > > > > This makes it harder (in theory) to incorrectly cast to CFArray from > > CFMutableArray since you must use checked_cf_cast<CFArrayRef>() and > > checked_cf_const_cast<CFMutableArrayRef>(). > > > > In practice, I'm not sure how much this difference matters. I can just add > > the const_cast<CF_BRIDGED_TYPE(ID) void*>() to WTF::checked_cf_cast<> and > > the compiler wouldn't complain about the 'const' being removed and then > > re-added. > > And I can check that CFMutable* objects are actually mutable using something > like this (which would be a Debug assertion to start with since there is no > security implication): > > inline bool CFArrayIsMutable(CFArrayRef array) > { > return [(id)array isMemberOfClass:[NSMutableArray class]]; > }
Actually this won't work, so will need to make more changes.
David Kilzer (:ddkilzer)
Comment 31
2018-01-03 09:35:38 PST
Created
attachment 330394
[details]
Patch v13
EWS Watchlist
Comment 32
2018-01-03 09:38:47 PST
Attachment 330394
[details]
did not pass style-queue: ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:70: Please replace ASSERT_WITH_SECURITY_IMPLICATION() with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(). [security/assertion] [5] Total errors found: 1 in 21 files If any of these errors are false positives, please file a bug against check-webkit-style.
David Kilzer (:ddkilzer)
Comment 33
2018-01-03 13:08:50 PST
(In reply to David Kilzer (:ddkilzer) from
comment #31
)
> Created
attachment 330394
[details]
> Patch v13
Okay, I'm done iterating on this. It's ready for review.
Joseph Pecoraro
Comment 34
2018-01-03 14:17:22 PST
Comment on
attachment 330394
[details]
Patch v13 View in context:
https://bugs.webkit.org/attachment.cgi?id=330394&action=review
Looks good to me. I didn't really understand the RetainPtr changes though so I'll let someone else review.
> Source/WTF/ChangeLog:30 > + Release buidls, as well as other "checked" functions.
Typo: "buidls" => "builds"
> Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp:47 > attributesDictionary = adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 4, &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); > - CFMutableDictionaryRef mutableAttributes = (CFMutableDictionaryRef)attributesDictionary.get(); > + CFMutableDictionaryRef mutableAttributes = checked_cf_cast<CFMutableDictionaryRef>(attributesDictionary.get());
Here I'd probably just switch to using `attributesDictionary.get()` locally instead of `mutableAttributes`. This is a local we just created on line 46, we shouldn't need to check its type.
> Source/WebCore/testing/cocoa/WebArchiveDumpSupport.mm:223 > - RetainPtr<CFMutableDictionaryRef> propertyList = adoptCF((CFMutableDictionaryRef)CFPropertyListCreateWithData(kCFAllocatorDefault, webArchiveData, kCFPropertyListMutableContainersAndLeaves, &format, &error)); > + RetainPtr<CFMutableDictionaryRef> propertyList = adoptCF(checked_cf_cast<CFMutableDictionaryRef>(CFPropertyListCreateWithData(kCFAllocatorDefault, webArchiveData, kCFPropertyListMutableContainersAndLeaves, &format, &error)));
For these WebArchive cases, I think that if we got an unexpected type that we would want to bail with an error message instead of crashing (inside a cast check). That said the checked casts are certainly better then previous behavior.
David Kilzer (:ddkilzer)
Comment 35
2018-01-05 11:49:04 PST
Comment on
attachment 330394
[details]
Patch v13 View in context:
https://bugs.webkit.org/attachment.cgi?id=330394&action=review
>> Source/WTF/ChangeLog:30 >> + Release buidls, as well as other "checked" functions. > > Typo: "buidls" => "builds"
Fixed. Thanks for spotting this!
>> Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp:47 >> + CFMutableDictionaryRef mutableAttributes = checked_cf_cast<CFMutableDictionaryRef>(attributesDictionary.get()); > > Here I'd probably just switch to using `attributesDictionary.get()` locally instead of `mutableAttributes`. This is a local we just created on line 46, we shouldn't need to check its type.
Done! Had to change the type of m_kernedCFStringAttributes and m_nonKernedCFStringAttributes in Font.h from RetainPtr<CFDictionaryRef> to RetainPtr<CFMutableDictionaryRef>, but that's more truthy anyway.
>> Source/WebCore/testing/cocoa/WebArchiveDumpSupport.mm:223 >> + RetainPtr<CFMutableDictionaryRef> propertyList = adoptCF(checked_cf_cast<CFMutableDictionaryRef>(CFPropertyListCreateWithData(kCFAllocatorDefault, webArchiveData, kCFPropertyListMutableContainersAndLeaves, &format, &error))); > > For these WebArchive cases, I think that if we got an unexpected type that we would want to bail with an error message instead of crashing (inside a cast check). That said the checked casts are certainly better then previous behavior.
At best we could output the CFTypeID of the incorrectly typed object. If it's a CoreFoundation type, then we might be able to give the name of the object type in the log output, but for CFTypes like DDResultRef (as a random example that probably would never happen here), I think the CFTypeID is assigned at runtime, so there's no way we could exhaustively map a CFTypeID to a string name at runtime. So I'm not sure that the CFTypeID by itself would be all that useful in the crash output (again unless it's a native CoreFoundation type--although I didn't check if those had static CFTypeIDs or not).
David Kilzer (:ddkilzer)
Comment 36
2018-01-05 13:19:47 PST
(In reply to Joseph Pecoraro from
comment #34
)
> Comment on
attachment 330394
[details]
> Patch v13 > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=330394&action=review
> > Looks good to me. I didn't really understand the RetainPtr changes though so > I'll let someone else review.
Internally, RetainPtr<> stores a pointer to the object it references using CFTypeRef: typedef CFTypeRef StorageType; And CFTypeRef is defined as: typedef const CF_BRIDGED_TYPE(id) void * CFTypeRef; The reason the const_cast<> is needed here is that some CF objects (like CFMutable*Ref types and most CF types defined outside of CoreFoundation.framework) are defined as non-const pointers (compare CFArrayRef to CFMutableArrayRef): typedef const struct CF_BRIDGED_TYPE(NSArray) __CFArray * CFArrayRef; typedef struct CF_BRIDGED_MUTABLE_TYPE(NSMutableArray) __CFArray * CFMutableArrayRef; typedef struct DD_BRIDGED_TYPE(id) __DDResult * DDResultRef; So when we request the "raw" pointer from a RetainPtr<> (using get() or leakRef()) with a template type that doesn't have a 'const' modifier, we need the const_cast<> to make sure the compiler doesn't emit a -Wcast-qual warning when casting from the internal 'const' (CFTypeRef) pointer to 'non-const' (template type) pointer. The const_cast<> is not needed for CFTypes with 'const' modifiers, but it does no harm since casting from non-const back to const is okay.
David Kilzer (:ddkilzer)
Comment 37
2018-01-05 13:23:22 PST
Created
attachment 330574
[details]
Patch v14
EWS Watchlist
Comment 38
2018-01-05 13:24:42 PST
Attachment 330574
[details]
did not pass style-queue: ERROR: Source/WTF/wtf/cf/TypeCastsCF.h:70: Please replace ASSERT_WITH_SECURITY_IMPLICATION() with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(). [security/assertion] [5] Total errors found: 1 in 22 files If any of these errors are false positives, please file a bug against check-webkit-style.
Joseph Pecoraro
Comment 39
2018-01-05 13:50:44 PST
Comment on
attachment 330574
[details]
Patch v14 r=me, thanks for the detailed explanation
WebKit Commit Bot
Comment 40
2018-01-05 15:34:43 PST
Comment on
attachment 330574
[details]
Patch v14 Rejecting
attachment 330574
[details]
from commit-queue. Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-01', 'land-attachment', '--force-clean', '--non-interactive', '--parent-command=commit-queue', 330574, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit Last 500 characters of output: .webkit.org/git/WebKit e552102..c1c0711 master -> origin/master Partial-rebuilding .git/svn/refs/remotes/origin/master/.rev_map.268f45cc-cd09-0410-ab3c-d52691b4dbfc ... Currently at 226466 = e55210209101d2e7c86dddd6a26640e11db1ea9d
r226467
= c1c07115837487ce093672773264ad8605be5ef6 Done rebuilding .git/svn/refs/remotes/origin/master/.rev_map.268f45cc-cd09-0410-ab3c-d52691b4dbfc First, rewinding head to replay your work on top of it... Fast-forwarded master to refs/remotes/origin/master. Full output:
http://webkit-queues.webkit.org/results/5947220
WebKit Commit Bot
Comment 41
2018-01-05 19:20:00 PST
Comment on
attachment 330574
[details]
Patch v14 Clearing flags on attachment: 330574 Committed
r226483
: <
https://trac.webkit.org/changeset/226483
>
WebKit Commit Bot
Comment 42
2018-01-05 19:20:03 PST
All reviewed patches have been landed. Closing bug.
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