Summary: | Compile error with GCC 4.6.0, tries to assign unsigned& to bitfield | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Xan Lopez <xan.lopez> | ||||||
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | eric, menard, xan.lopez | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | PC | ||||||||
OS: | OS X 10.5 | ||||||||
Attachments: |
|
Description
Xan Lopez
2011-04-22 17:36:13 PDT
Created attachment 90814 [details]
unaryplus.diff
Comment on attachment 90814 [details] unaryplus.diff View in context: https://bugs.webkit.org/attachment.cgi?id=90814&action=review > Source/JavaScriptCore/runtime/Structure.cpp:103 > + // Use unary '+' for m_attributesInPrevious to force precise > + // type detection with GCC >= 4.6.0. See > + // https://bugs.webkit.org/show_bug.cgi?id=59261 for more > + // details. Can this be written in one line? > Source/JavaScriptCore/runtime/Structure.cpp:132 > + // Use unary '+' for m_attributesInPrevious to force precise > + // type detection with GCC >= 4.6.0. See > + // https://bugs.webkit.org/show_bug.cgi?id=59261 for more > + // details. Ditto. > Source/JavaScriptCore/runtime/Structure.h:304 > + // Use unary '+' for m_attributesInPrevious to force precise > + // type detection with GCC >= 4.6.0. See > + // https://bugs.webkit.org/show_bug.cgi?id=59261 for more > + // details. Ditto. (In reply to comment #2) > (From update of attachment 90814 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=90814&action=review > > > Source/JavaScriptCore/runtime/Structure.cpp:103 > > + // Use unary '+' for m_attributesInPrevious to force precise > > + // type detection with GCC >= 4.6.0. See > > + // https://bugs.webkit.org/show_bug.cgi?id=59261 for more > > + // details. > > Can this be written in one line? > Wouldn't that be a lot more difficult to read? No other comment in the file seems to do this when they are long-ish. Are you asking because of the weird line-breaks and the bugzilla URL? @ap, please r+ or r-. static_cast would be my preference, but let's see what Anders or Darin think. Comment on attachment 90814 [details] unaryplus.diff The patch looks correct, but I'd prefer a more generic comment; you'll get this error with any compiler whose standard library has an std::make_pair implementation that takes value references. How about something like: // Newer versions of the STL have an std::make_pair function that takes rvalue references. // When either of the parameters are bitfields, the C++ compiler will try to bind them as lvalues, which is invalid. To work around this, use unary "+" to make the parameter an rvalue. // See https://bugs.webkit.org/show_bug.cgi?id=59261 for more details. Created attachment 92066 [details]
Patch for landing
Committed r85621: <http://trac.webkit.org/changeset/85621> |