Bug 117791

Summary: Fixing some compiler warnings
Product: WebKit Reporter: Xabier Rodríguez Calvar <calvaris>
Component: New BugsAssignee: Xabier Rodríguez Calvar <calvaris>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, apinheiro, buildbot, cfleizach, cgarcia, commit-queue, dmazzoni, eflews.bot, gustavo, gyuyoung.kim, gyuyoung.kim, jdiggs, mario, mrobinson, rakuco, rniwa, webkit-ews, zan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Description Xabier Rodríguez Calvar 2013-06-19 04:39:24 PDT
Fixing some compiler warnings
Comment 1 Xabier Rodríguez Calvar 2013-06-19 04:45:08 PDT
Created attachment 204989 [details]
Patch

Fixed some warnings.
Comment 2 WebKit Commit Bot 2013-06-19 04:47:40 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Build Bot 2013-06-19 10:48:53 PDT
Comment on attachment 204989 [details]
Patch

Attachment 204989 [details] did not pass win-ews (win):
Output: http://webkit-queues.appspot.com/results/945263
Comment 4 Xabier Rodríguez Calvar 2013-06-19 14:42:39 PDT
Created attachment 205032 [details]
Patch

Fixed windows problems, hopefully.
Comment 5 Build Bot 2013-06-19 22:00:44 PDT
Comment on attachment 205032 [details]
Patch

Attachment 205032 [details] did not pass win-ews (win):
Output: http://webkit-queues.appspot.com/results/904623
Comment 6 Xabier Rodríguez Calvar 2013-06-20 03:28:25 PDT
Created attachment 205065 [details]
Patch

Fixed windows problems, again, hopefully.
Comment 7 EFL EWS Bot 2013-06-20 03:31:07 PDT
Comment on attachment 205065 [details]
Patch

Attachment 205065 [details] did not pass efl-ews (efl):
Output: http://webkit-queues.appspot.com/results/923781
Comment 8 EFL EWS Bot 2013-06-20 03:32:10 PDT
Comment on attachment 205065 [details]
Patch

Attachment 205065 [details] did not pass efl-wk2-ews (efl-wk2):
Output: http://webkit-queues.appspot.com/results/880478
Comment 9 Early Warning System Bot 2013-06-20 03:34:29 PDT
Comment on attachment 205065 [details]
Patch

Attachment 205065 [details] did not pass qt-ews (qt):
Output: http://webkit-queues.appspot.com/results/951479
Comment 10 Xabier Rodríguez Calvar 2013-06-20 03:35:12 PDT
Created attachment 205067 [details]
Patch

Changelog issue.
Comment 11 EFL EWS Bot 2013-06-20 03:38:14 PDT
Comment on attachment 205067 [details]
Patch

Attachment 205067 [details] did not pass efl-ews (efl):
Output: http://webkit-queues.appspot.com/results/880480
Comment 12 EFL EWS Bot 2013-06-20 03:40:53 PDT
Comment on attachment 205067 [details]
Patch

Attachment 205067 [details] did not pass efl-wk2-ews (efl-wk2):
Output: http://webkit-queues.appspot.com/results/880483
Comment 13 Early Warning System Bot 2013-06-20 03:40:56 PDT
Comment on attachment 205067 [details]
Patch

Attachment 205067 [details] did not pass qt-ews (qt):
Output: http://webkit-queues.appspot.com/results/943476
Comment 14 Early Warning System Bot 2013-06-20 03:43:26 PDT
Comment on attachment 205067 [details]
Patch

Attachment 205067 [details] did not pass qt-wk2-ews (qt-wk2):
Output: http://webkit-queues.appspot.com/results/924685
Comment 15 Xabier Rodríguez Calvar 2013-06-20 04:20:54 PDT
Created attachment 205070 [details]
Patch

Added WTF include dir to cmake in netscape plugin to build efl and qt properly.
Comment 16 Early Warning System Bot 2013-06-20 04:25:14 PDT
Comment on attachment 205070 [details]
Patch

Attachment 205070 [details] did not pass qt-ews (qt):
Output: http://webkit-queues.appspot.com/results/924692
Comment 17 Early Warning System Bot 2013-06-20 04:27:34 PDT
Comment on attachment 205070 [details]
Patch

Attachment 205070 [details] did not pass qt-wk2-ews (qt-wk2):
Output: http://webkit-queues.appspot.com/results/951485
Comment 18 Xabier Rodríguez Calvar 2013-06-20 06:44:19 PDT
Created attachment 205084 [details]
Patch

Added WTF include dir to cmake in netscape plugin to build efl and qt properly.
Comment 19 Martin Robinson 2013-06-20 11:18:08 PDT
Comment on attachment 205084 [details]
Patch

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

> Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp:637
> +        offsetType = GAIL_AT_OFFSET; // to prevent a compiler warning

I'd prefer this to be defined when the variable is declared. Comments should be complete sentences with a capital letter and a period, but it's okay if you just omit these kind of comments completely.

> Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h:31
> +#ifndef WTF_EXPORT_PRIVATE
> +#define WTF_EXPORT_PRIVATE
> +#endif

Is this usually defined in config.h?

> Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp:47
> +#ifdef CRASH
> +#undef CRASH
> +#endif
> +

Maybe it would be better to simply pick a non-conflicting macro name?

> Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp:223
> +        index = 0; // to avoid compiler warnings

I think it's better to set the value of 'index' when you declare it and omit the comment.
Comment 20 Xabier Rodríguez Calvar 2013-06-20 15:16:06 PDT
(In reply to comment #19)
> (From update of attachment 205084 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=205084&action=review
> 
> > Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp:637
> > +        offsetType = GAIL_AT_OFFSET; // to prevent a compiler warning
> 
> I'd prefer this to be defined when the variable is declared. Comments should be complete sentences with a capital letter and a period, but it's okay if you just omit these kind of comments completely.

Roger that. I did it like this because initialization is supposed to happen always and the default only when something wrong happens, which would be rare. Anyway, compiler can optimize it in a different way and my assumption might be irrelevant.

> > Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h:31
> > +#ifndef WTF_EXPORT_PRIVATE
> > +#define WTF_EXPORT_PRIVATE
> > +#endif
> 
> Is this usually defined in config.h?
> 
> > Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp:47
> > +#ifdef CRASH
> > +#undef CRASH
> > +#endif
> > +
> 
> Maybe it would be better to simply pick a non-conflicting macro name?

These two cases come from including <wtf/Assertions.h>. When I add it, I get compilation errors because of those two cases, the first is not defined and the second is redefined. I could define the export in config.h and maybe change the CRASH macro at main.cpp so that it doesn't conflict with the one in the <wtf/Assertions.h> as you suggest and if I understood you correctly.

Other solution would be defining the WTF_ATTRIBUTE_PRINTF macro for those cases instead of just including the header that also causes the other problems.

> > Tools/TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp:223
> > +        index = 0; // to avoid compiler warnings
> 
> I think it's better to set the value of 'index' when you declare it and omit the comment.

Same as in the first case.
Comment 21 Xabier Rodríguez Calvar 2013-06-25 04:46:42 PDT
Created attachment 205382 [details]
Patch

Changed according Martin's comments.
Comment 22 Build Bot 2013-06-25 04:50:39 PDT
Comment on attachment 205382 [details]
Patch

Attachment 205382 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/919110
Comment 23 Early Warning System Bot 2013-06-25 04:53:02 PDT
Comment on attachment 205382 [details]
Patch

Attachment 205382 [details] did not pass qt-ews (qt):
Output: http://webkit-queues.appspot.com/results/849378
Comment 24 EFL EWS Bot 2013-06-25 04:53:12 PDT
Comment on attachment 205382 [details]
Patch

Attachment 205382 [details] did not pass efl-ews (efl):
Output: http://webkit-queues.appspot.com/results/912669
Comment 25 EFL EWS Bot 2013-06-25 04:53:58 PDT
Comment on attachment 205382 [details]
Patch

Attachment 205382 [details] did not pass efl-wk2-ews (efl-wk2):
Output: http://webkit-queues.appspot.com/results/849377
Comment 26 Build Bot 2013-06-25 05:11:19 PDT
Comment on attachment 205382 [details]
Patch

Attachment 205382 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/850837
Comment 27 Early Warning System Bot 2013-06-25 05:54:32 PDT
Comment on attachment 205382 [details]
Patch

Attachment 205382 [details] did not pass qt-wk2-ews (qt-wk2):
Output: http://webkit-queues.appspot.com/results/930294
Comment 28 Build Bot 2013-06-25 08:35:45 PDT
Comment on attachment 205382 [details]
Patch

Attachment 205382 [details] did not pass win-ews (win):
Output: http://webkit-queues.appspot.com/results/894248
Comment 29 Xabier Rodríguez Calvar 2013-06-26 05:57:32 PDT
Created attachment 205480 [details]
Patch

Fixed Mac compilation and trying fixes for Qt and EFL
Comment 30 EFL EWS Bot 2013-06-26 06:01:09 PDT
Comment on attachment 205480 [details]
Patch

Attachment 205480 [details] did not pass efl-ews (efl):
Output: http://webkit-queues.appspot.com/results/919205
Comment 31 EFL EWS Bot 2013-06-26 06:01:31 PDT
Comment on attachment 205480 [details]
Patch

Attachment 205480 [details] did not pass efl-wk2-ews (efl-wk2):
Output: http://webkit-queues.appspot.com/results/946330
Comment 32 Early Warning System Bot 2013-06-26 06:02:51 PDT
Comment on attachment 205480 [details]
Patch

Attachment 205480 [details] did not pass qt-ews (qt):
Output: http://webkit-queues.appspot.com/results/919207
Comment 33 Early Warning System Bot 2013-06-26 06:04:56 PDT
Comment on attachment 205480 [details]
Patch

Attachment 205480 [details] did not pass qt-wk2-ews (qt-wk2):
Output: http://webkit-queues.appspot.com/results/930442
Comment 34 Xabier Rodríguez Calvar 2013-06-26 09:42:02 PDT
Created attachment 205504 [details]
Patch

Including ExportMacros.h instead of the config.h mess.
Comment 35 Martin Robinson 2013-06-26 12:02:05 PDT
Comment on attachment 205504 [details]
Patch

I think to fix a warning the changes to the plugin are too big and risky (for instance, linking against wtf). Let's just silence this warning on GTK+.
Comment 36 Xabier Rodríguez Calvar 2013-06-26 15:17:08 PDT
Created attachment 205529 [details]
Patch

Silenced format warning for Gtk+ as required by Martin.
Comment 37 Carlos Garcia Campos 2013-06-27 06:27:47 PDT
Comment on attachment 205529 [details]
Patch

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

> Source/WebCore/ChangeLog:8
> +        No new tests needed.

You don't need to include this line when it's obvious, like in this case that you are fixing compile warnings.

> Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:315
> +        0, // willLoadURLRequest;
> +        0, // willLoadDataRequest;

Those trailing ; are weird, but harmless anyway
Comment 38 WebKit Commit Bot 2013-06-27 06:49:11 PDT
Comment on attachment 205529 [details]
Patch

Clearing flags on attachment: 205529

Committed r152095: <http://trac.webkit.org/changeset/152095>
Comment 39 WebKit Commit Bot 2013-06-27 06:49:17 PDT
All reviewed patches have been landed.  Closing bug.