Bug 69080 - [WEBKIT2] Fix for compilation warnings in WebContext.cpp
Summary: [WEBKIT2] Fix for compilation warnings in WebContext.cpp
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-29 03:56 PDT by Goutham J
Modified: 2011-12-01 23:02 PST (History)
1 user (show)

See Also:


Attachments
Warning fix (2.26 KB, patch)
2011-09-29 03:57 PDT, Goutham J
darin: review+
Details | Formatted Diff | Diff
Warning fix (2.31 KB, patch)
2011-10-19 11:32 PDT, Goutham J
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Goutham J 2011-09-29 03:56:16 PDT
We get following compilation warnings while building WebContext.cpp,

  CC     Source/WebKit2/UIProcess/API/gtk/tests/Programs_unittests_webkit2_testloading-testloading.o
  CC     Tools/GtkLauncher/Programs_GtkLauncher2-main.o
/bin/mkdir -p ./.deps/DerivedSources
../../Source/WebKit2/UIProcess/WebContext.cpp: In member function ‘void WebKit::WebContext::processDidFinishLaunching(WebKit::WebProcessProxy*)’:
../../Source/WebKit2/UIProcess/WebContext.cpp:325:95: warning: format ‘%llu’ expects type ‘long long unsigned int’, but argument 2 has type ‘uint64_t’
../../Source/WebKit2/UIProcess/WebContext.cpp: In member function ‘void WebKit::WebContext::startMemorySampler(double)’:
../../Source/WebKit2/UIProcess/WebContext.cpp:741:91: warning: format ‘%llu’ expects type ‘long long unsigned int’, but argument 2 has type ‘uint64_t’


This is because, format-specifier llu expects 'unsigned long long int', whereas in Linux uint64_t is 'unsigned long int'. Type-casting to 'unsigned long long int' instead of 'uint64_t' should work in all platforms.
Comment 1 Goutham J 2011-09-29 03:57:50 PDT
Created attachment 109146 [details]
Warning fix
Comment 2 Darin Adler 2011-10-17 13:03:15 PDT
Comment on attachment 109146 [details]
Warning fix

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

> Source/WebKit2/UIProcess/WebContext.cpp:325
> +        String sampleLogFilePath = String::format("WebProcess%llu", static_cast<unsigned long long int>(now));

No reason to include the word “int”.

> Source/WebKit2/UIProcess/WebContext.cpp:741
> +    String sampleLogFilePath = String::format("WebProcess%llu", static_cast<unsigned long long int>(now));

No reason to include the word “int”.
Comment 3 Goutham J 2011-10-19 11:32:42 PDT
Created attachment 111652 [details]
Warning fix
Comment 4 Hajime Morrita 2011-12-01 22:37:52 PST
Comment on attachment 111652 [details]
Warning fix

Looks ultra-trivial and addressed Darin's point. r+ing.
Comment 5 WebKit Review Bot 2011-12-01 23:02:08 PST
Comment on attachment 111652 [details]
Warning fix

Clearing flags on attachment: 111652

Committed r101746: <http://trac.webkit.org/changeset/101746>
Comment 6 WebKit Review Bot 2011-12-01 23:02:12 PST
All reviewed patches have been landed.  Closing bug.