RESOLVED FIXED Bug 81061
Functions with C linkage should return POD types
https://bugs.webkit.org/show_bug.cgi?id=81061
Summary Functions with C linkage should return POD types
Filip Pizlo
Reported 2012-03-13 17:01:46 PDT
They should return either primitive C types or C structs (i.e. structs that do not have methods).
Attachments
the patch (3.74 KB, patch)
2012-03-13 17:02 PDT, Filip Pizlo
no flags
the patch (3.66 KB, patch)
2012-03-13 17:28 PDT, Filip Pizlo
mrowe: review+
Filip Pizlo
Comment 1 2012-03-13 17:02:51 PDT
Created attachment 131752 [details] the patch
WebKit Review Bot
Comment 2 2012-03-13 17:08:25 PDT
Attachment 131752 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source..." exit_code: 1 Source/JavaScriptCore/ChangeLog:3: ChangeLog entry has no bug number [changelog/bugnumber] [5] Total errors found: 1 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Filip Pizlo
Comment 3 2012-03-13 17:28:06 PDT
Created attachment 131758 [details] the patch Corrected the comment. Apparently, the requirements for return types of functions with C linkage match the C++-03 definition of POD (a strict subset of aggregate types - so no C++-style members, only POD fields). The C++-11 definition has been split up into two separate concepts (trivial and standard-layout). Prior to this code we were returning standard-layout but not non-trivial (and thus not POD) classes, which is correct in C++-11 but not C++-03.
WebKit Review Bot
Comment 4 2012-03-13 17:30:31 PDT
Attachment 131758 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source..." exit_code: 1 Source/JavaScriptCore/ChangeLog:3: ChangeLog entry has no bug number [changelog/bugnumber] [5] Total errors found: 1 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Mark Rowe (bdash)
Comment 5 2012-03-13 17:32:52 PDT
Comment on attachment 131758 [details] the patch View in context: https://bugs.webkit.org/attachment.cgi?id=131758&action=review Looks fine to me. > Source/JavaScriptCore/ChangeLog:3 > + Need a short description and bug URL (OOPS!) Describe the problem! > Source/JavaScriptCore/dfg/DFGOperations.h:160 > +// According to C++ rules, a type used for the return signature of function with C linkage (i.e. > +// 'extern "C"') needs to be POD in the C++-03 sense: loosely speaking it must have nothing more than > +// those members that would be valid in C. This means no constructors. I don't think it's necessary to explain what a POD type is here. I'd simplify this to something like: // Since this type is used in the signature of a function declared with C linkage it must be a POD type. > Source/JavaScriptCore/llint/LLIntSlowPaths.h:44 > +// According to C++ rules, a type used for the return signature of function with C linkage (i.e. > +// 'extern "C"') needs to be POD in the C++-03 sense: loosely speaking it must have nothing more than > +// those members that would be valid in C. This means no constructors. Same comment about the comment here.
Filip Pizlo
Comment 6 2012-03-13 17:46:23 PDT
Note You need to log in before you can comment on or make changes to this bug.