Bug 150520 - Fix CMake compile error and add correct null check
Summary: Fix CMake compile error and add correct null check
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-23 16:59 PDT by Alex Christensen
Modified: 2015-10-26 10:24 PDT (History)
1 user (show)

See Also:


Attachments
Patch (1.53 KB, patch)
2015-10-23 16:59 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2015-10-23 16:59:31 PDT
Fix CMake compile error and add correct null check
Comment 1 Alex Christensen 2015-10-23 16:59:49 PDT
Created attachment 263961 [details]
Patch
Comment 2 WebKit Commit Bot 2015-10-23 18:12:20 PDT
Comment on attachment 263961 [details]
Patch

Clearing flags on attachment: 263961

Committed r191528: <http://trac.webkit.org/changeset/191528>
Comment 3 WebKit Commit Bot 2015-10-23 18:12:24 PDT
All reviewed patches have been landed.  Closing bug.
Comment 4 Darin Adler 2015-10-24 13:47:04 PDT
Comment on attachment 263961 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=263961&action=review

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:3217
> -    typeof(updateBlock) updateBlockCopy = nil;
> +    void (^updateBlockCopy)(void) = nil;

How is this a “CMake” compile error? Since CMake is not a C compiler, I don’t understand how using CMake causes this to be a compile error when it’s not an error without CMake. Is CMake passing different options to clang?

Also, I suggest using auto instead of what we did here.
Comment 5 Alex Christensen 2015-10-26 10:24:04 PDT
(In reply to comment #4)
> Comment on attachment 263961 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=263961&action=review
> 
> > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:3217
> > -    typeof(updateBlock) updateBlockCopy = nil;
> > +    void (^updateBlockCopy)(void) = nil;
> 
> How is this a “CMake” compile error? Since CMake is not a C compiler, I
> don’t understand how using CMake causes this to be a compile error when it’s
> not an error without CMake. Is CMake passing different options to clang?
Yes, CMake is currently passing different compile flags, and I'm not sure why this doesn't compile, but with typeof(updateBlock) as the variable type it has unrecognized identifier syntax errors.
> 
> Also, I suggest using auto instead of what we did here.
Good idea!