RESOLVED FIXED 146007
Remove build warnings in Tools/DumpRenderTree/TestNetscapePlugIn
https://bugs.webkit.org/show_bug.cgi?id=146007
Summary Remove build warnings in Tools/DumpRenderTree/TestNetscapePlugIn
Tanay
Reported 2015-06-15 23:16:39 PDT
../../Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:68:108: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format] messageLength += vsnprintf(message + messageLength, messageBufferSize - 1 - messageLength, format, args); ^ ../../Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:68:108: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]
Attachments
Patch (2.37 KB, patch)
2015-06-15 23:20 PDT, Tanay
no flags
Patch (3.19 KB, patch)
2015-06-19 05:04 PDT, Tanay
no flags
Patch (3.28 KB, patch)
2015-06-22 05:07 PDT, Tanay
no flags
Tanay
Comment 1 2015-06-15 23:20:38 PDT
Darin Adler
Comment 2 2015-06-16 10:51:03 PDT
Comment on attachment 254937 [details] Patch I am pretty sure you could use attribute rather than __attribute__. In macros it makes sense to use the form less likely to conflict, but in code like this it doesn’t seem necessary.
Darin Adler
Comment 3 2015-06-16 10:52:12 PDT
Comment on attachment 254937 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=254937&action=review For best compatibility across platforms would be much better to use WTF_ATTRIBUTE_PRINTF. Please do that. > Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:63 > +void __attribute__((format(printf, 2, 0))) pluginLogWithArguments(NPP instance, const char* format, va_list args) Oops, no this is wrong. Needs to use WTF_ATTRIBUTE_PRINTF
Gyuyoung Kim
Comment 4 2015-06-16 22:41:58 PDT
Comment on attachment 254937 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=254937&action=review > Tools/ChangeLog:3 > + [EFL] Remove build warnings in Tools/DumpRenderTree/TestNetscapePlugIn I think this patch isn't only for EFL port. Please remove [EFL] prefix or add other ports too.
Tanay
Comment 5 2015-06-16 23:54:32 PDT
I am getting compilation errors if this macro is used. It seems like the 'WTF_ATTRIBUTE_PRINTF' macro is not available in this directory. This is conditionally compiled for ENABLE_X11_TARGET flag. if (ENABLE_X11_TARGET) add_subdirectory(DumpRenderTree/TestNetscapePlugIn) Please advice.
Darin Adler
Comment 6 2015-06-17 11:00:08 PDT
(In reply to comment #5) > I am getting compilation errors if this macro is used. > > It seems like the 'WTF_ATTRIBUTE_PRINTF' macro is not available in this > directory. I don’t think it’s the directory, but rather the includes. You’ll have to include an appropriate WTF header file to use WTF_ATTRIBUTE_PRINTF. It doesn’t compile because it’s not including the header file. I think it’s <wtf/Assertions.h>. > This is conditionally compiled for ENABLE_X11_TARGET flag. > if (ENABLE_X11_TARGET) > add_subdirectory(DumpRenderTree/TestNetscapePlugIn) That’s in the make file used for the EFL port. This same plug-in is built, just built with other build systems, for other ports that don’t necessarily share that make file.
Tanay
Comment 7 2015-06-18 04:41:34 PDT
After including the <wtf/Assertions.h> header and I get the following error ../../Source/WTF/wtf/Assertions.h:130:1: error: ‘WTF_EXPORT_PRIVATE’ does not name a type
Tanay
Comment 8 2015-06-19 00:02:51 PDT
Are there some additional dependencies that I am missing? I have tried linking with the WTF library but it does not resolve.
Csaba Osztrogonác
Comment 9 2015-06-19 02:15:53 PDT
(In reply to comment #8) > Are there some additional dependencies that I am missing? > I have tried linking with the WTF library but it does not resolve. Assertions.h needs WTF_EXPORT_PRIVATE, which is defined in wtf/ExportMacros.h. And wtf/ExportMacros.h needs OS/USE/COMPILER macros which are defined in Platform.h. Adding these includes in exactly this order + adding WTF to include path in cmake build system solves this issue ... But it is very ugly and style checker will warn because of unordered includes ... #include <wtf/Platform.h> #include <wtf/ExportMacros.h> #include <wtf/Assertions.h>
Tanay
Comment 10 2015-06-19 05:04:25 PDT
Tanay
Comment 11 2015-06-19 05:05:36 PDT
Thanks for the clarifications. Uploaded a patch with the changes.
Darin Adler
Comment 12 2015-06-19 10:51:22 PDT
I’m surprised that Assertions.h does not itself include those other headers. I think maybe it’s because we expect those other headers to be included universally as part of config.h or precompiled headers.
WebKit Commit Bot
Comment 13 2015-06-22 00:26:13 PDT
Comment on attachment 255187 [details] Patch Rejecting attachment 255187 [details] from commit-queue. Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.appspot.com', '--bot-id=webkit-cq-03', 'apply-attachment', '--no-update', '--non-interactive', 255187, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit Last 500 characters of output: zz 3. patching file Tools/DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt Hunk #1 FAILED at 33. 1 out of 1 hunk FAILED -- saving rejects to file Tools/DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt.rej patching file Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp patching file Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force', '--reviewer', u'Darin Adler']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit Full output: http://webkit-queues.appspot.com/results/4736415837454336
Tanay
Comment 14 2015-06-22 05:07:34 PDT
Tanay
Comment 15 2015-06-22 05:08:48 PDT
Re-based and uploaded the patch.
WebKit Commit Bot
Comment 16 2015-06-23 03:46:16 PDT
Comment on attachment 255342 [details] Patch Clearing flags on attachment: 255342 Committed r185871: <http://trac.webkit.org/changeset/185871>
WebKit Commit Bot
Comment 17 2015-06-23 03:46:20 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.