[Webkit-unassigned] [Bug 238482] Build failure with g++ 12: DMIs before end of enclosing class

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 31 01:38:28 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=238482

--- Comment #9 from Jonathan Wakely <zilla at kayari.org> ---
Yet another option would be to replace the initializers with simpler ones. G++ just got a change to process some initializers immediately, instead of after the class is complete. So:

--- webkit11.ii 2022-03-30 12:38:21.928429136 +0100
+++ webkit11.ii~        2022-03-30 12:39:46.985998048 +0100
@@ -240218,11 +240218,11 @@
             }


-            unsigned lineNumber { std::numeric_limits<unsigned>::max() };
-            unsigned columnNumber { std::numeric_limits<unsigned>::max() };
+            unsigned lineNumber { UINT_MAX };
+            unsigned columnNumber { UINT_MAX };
             BytecodeIndex bytecodeIndex;
             CodeBlockHash codeBlockHash;
-            JITType jitType { JITType::None };
+            JITType jitType { };
             bool isRegExp { false };
         };


Using the UINT_MAX macro doesn't need to do name lookup, so can be parsed immediately. But yes, it means using a macro not numeric_limits, sorry :-(
Alternatively, use { ~0u } to get the all-ones unsigned value.

The JITType init works because value-init with {} will init to zero, which happens to be the value of JITType::None. That's a bit fragile if you ever wanted to change the value of None, or wanted to init to a different value.

My preference would be the empty default ctor in comment 8.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220331/d1af7879/attachment.htm>


More information about the webkit-unassigned mailing list