<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><div class="" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">Currently we have this:</div><div class="" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"><br class=""><div class=""><a href="https://webkit.org/code-style-guidelines/#pointers-and-references" class="">https://webkit.org/code-style-guidelines/#pointers-and-references</a><div class=""><br class=""></div><div class="">Pointers and References</div><div class="">Pointer types in non-C++ code</div><div class="">Pointer types should be written with a space between the type and the * (so the * is adjacent to the following identifier if any).</div><div class=""><br class=""></div></div></div></div><div class=""><font color="#000000" class="">This is not what was originally intended, and I’m planning to fix the document. </font></div><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><br class=""></span></div><div class=""><font color="#000000" class="">The original idea was to say: “Objective-C classes should have space between the type name and the *”.</font></div><div class=""><font color="#000000" class=""><br class=""></font></div><div class=""><font color="#000000" class="">I can update the document to reflect this. However, this rule is a bit difficult to enforce and quite difficult to format automatically. Also, subjectively for me, it is a bit hard to remember. Maybe also for other people, as current Objective-C++ is formatted inconsistently in this regard.</font></div><div class=""><font color="#000000" class=""><br class=""></font></div><div class=""><font color="#000000" class="">To enforce this, I’d imagine we hardcode a semi-comprehensive list of Objective-C class names to check-webkit-style. For automatic formatting, the scripts can fix up clang-format diffs based on the hardcoded list.</font></div><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><br class=""></span></div><div class="" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">An alternative suggestion would be to change the rule and document as follows:</div><div class="" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"> * All pointers, references and rvalue-references in Objective-C++ are formatted as current C++ style mandates</div><div class="" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"> * All C and Objective-C code should be formatted with rules consistent to the C++ rules</div><div class="" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"> * The exception would be public Objective-C headers and WebKit SPI headers, which would be formatted as part of Apple internal API definition process<div class=""><br class=""></div><div class="">The change above would be fitting to programmatic formatting and format verification, as it simplifies the rules and avoids the need of semantic analysis of the code for the formatting purposes.</div><div class=""><br class=""></div><div class=""><div class="">Please reply to this to discuss which way would be preferable.</div><div class=""><br class=""></div><div class="">The bug:</div><div class=""><a href="https://bugs.webkit.org/show_bug.cgi?id=234294" class="">https://bugs.webkit.org/show_bug.cgi?id=234294</a></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Br,</div><div class="">Kimmo</div></div></div></body></html>