Bug 174392

Summary: [SOUP] Do not use C linkage for functions using C++ features
Product: WebKit Reporter: Adrian Perez <aperez>
Component: WebKit Misc.Assignee: Adrian Perez <aperez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, berto, buildbot, cgarcia, danw, gustavo, mcatanzaro, mrobinson, svillar
Priority: P2    
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Adrian Perez
Reported 2017-07-11 14:28:18 PDT
Building with Clang emits the following warning: In file included from ../../Source/WebKit2/NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:33: In file included from DerivedSources/ForwardingHeaders/WebCore/WebKitSoupRequestGeneric.h:1: Source/WebCore/platform/network/soup/WebKitSoupRequestGeneric.h:61:33: warning: 'webkitSoupRequestGenericGetRequest' has C-linkage specified, but returns user-defined type 'const WebCore::ResourceRequest &' which is incompatible with C [-Wreturn-type-c-linkage] const WebCore::ResourceRequest& webkitSoupRequestGenericGetRequest(WebKitSoupRequestGeneric*); ^ I'll be uploading a patch for this momentarily.
Attachments
Patch (1.84 KB, patch)
2017-07-11 14:33 PDT, Adrian Perez
no flags
Patch (1.81 KB, patch)
2017-07-12 03:11 PDT, Adrian Perez
no flags
Adrian Perez
Comment 1 2017-07-11 14:33:13 PDT
Michael Catanzaro
Comment 2 2017-07-11 15:28:28 PDT
Comment on attachment 315169 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=315169&action=review That's a good warning. Why can't GCC do that? > Source/WebCore/platform/network/soup/WebKitSoupRequestGeneric.h:61 > +// The following functions used from C++ only, they should be outside > +// of the G_BEGIN_DECLS/G_END_DECLS block. This should be obvious to anyone familiar with the intended use of G_BEGIN_DECLS and G_END_DECLS, and it's a pattern we'll need to follow in many private GObject header files wherever references are used in function signatures, so I would remove the comment.
Adrian Perez
Comment 3 2017-07-12 03:03:44 PDT
(In reply to Michael Catanzaro from comment #2) > Comment on attachment 315169 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=315169&action=review > > That's a good warning. Why can't GCC do that? GCC does not have -Wreturn-type-c-linkage. It does have -Wreturn-type but it does not warn in this particular case :-/ > > Source/WebCore/platform/network/soup/WebKitSoupRequestGeneric.h:61 > > +// The following functions used from C++ only, they should be outside > > +// of the G_BEGIN_DECLS/G_END_DECLS block. > > This should be obvious to anyone familiar with the intended use of > G_BEGIN_DECLS and G_END_DECLS, and it's a pattern we'll need to follow in > many private GObject header files wherever references are used in function > signatures, so I would remove the comment. Then I'll remove the comment and land the patch. Thanks for reviewing.
Adrian Perez
Comment 4 2017-07-12 03:11:31 PDT
Adrian Perez
Comment 5 2017-07-12 03:12:44 PDT
Comment on attachment 315224 [details] Patch Clearing flags on attachment: 315224 Committed r219387: <http://trac.webkit.org/changeset/219387>
Adrian Perez
Comment 6 2017-07-12 03:12:49 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.