Bug 51754

Summary: WebKit 2 does not build on 64bits with a recent GCC
Product: WebKit Reporter: Benjamin Poulain <benjamin>
Component: New BugsAssignee: Benjamin Poulain <benjamin>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, commit-queue, joepeck, kbalazs, ossy, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Bug Depends on: 51629    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Sorry for the delay, quick update :) none

Description Benjamin Poulain 2010-12-30 09:54:01 PST
Following http://trac.webkit.org/changeset/74690, WebKit 2 does not compile on 64 bits with a recent GCC.

The problem comes from the use of the type "unsigned long long" in the encoders and decoders. This type can be different from uint64_t on 64 bits, in which case it does not have any specialization for encoding and decoding.
Comment 1 Benjamin Poulain 2010-12-30 10:09:40 PST
Created attachment 77686 [details]
Patch
Comment 2 Sam Weinig 2010-12-30 14:15:13 PST
Comment on attachment 77686 [details]
Patch

You should instead change the type in OriginAndDatabases.h to be uint64_t.
Comment 3 Benjamin Poulain 2010-12-30 14:31:38 PST
(In reply to comment #2)
> (From update of attachment 77686 [details])
> You should instead change the type in OriginAndDatabases.h to be uint64_t.

Ok, I'll do that tomorrow.

I thought about changing the class to use uint64_t but the type is almost never used in WebKit so I assumed it not commonly used by the project.
Comment 4 Benjamin Poulain 2011-01-02 09:28:30 PST
Created attachment 77777 [details]
Sorry for the delay, quick update :)
Comment 5 Benjamin Poulain 2011-01-02 09:57:19 PST
*** Bug 51781 has been marked as a duplicate of this bug. ***
Comment 6 Balazs Kelemen 2011-01-02 10:14:10 PST
I better like my patch (what a cocky person I am) because that allows using 
either int, long, long long, int32_t and int64_t and the appropriate unsigned types
at the call sites so hopefully it eliminates the possibility of further build breakage.
If you agree, please invert the duplicate marking :)
Comment 7 Benjamin Poulain 2011-01-02 11:28:19 PST
(In reply to comment #6)
> I better like my patch (what a cocky person I am) because that allows using 
> either int, long, long long, int32_t and int64_t and the appropriate unsigned types
> at the call sites so hopefully it eliminates the possibility of further build breakage.

It already does support the types up to 64 bits. The problem is, "long long int" is not necessarily 64 bits, that is why gcc refuses passing this type to a "long int".

stdint have been introduced to solve the problem that different compilers have different size of types. I would use that :)
Comment 8 WebKit Commit Bot 2011-01-02 17:30:04 PST
Comment on attachment 77777 [details]
Sorry for the delay, quick update :)

Clearing flags on attachment: 77777

Committed r74882: <http://trac.webkit.org/changeset/74882>
Comment 9 WebKit Commit Bot 2011-01-02 17:30:12 PST
All reviewed patches have been landed.  Closing bug.