Bug 150520

Summary: Fix CMake compile error and add correct null check
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

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!