<div dir="ltr">I sfrongly support this idea. The list of bugs that have occurred due to simple lacking {} is long. It's even harder now that people who use Python and C sometimes glitch when moving back and forth and forget that indentation in C is meaningless. I ran a piece of broken C (multi-line if missing {}) by a Python/C programmer just now, with this error, and they did not even call it out, even after I gave them some hints. They were in Python mode today.<div><br></div><div>It's one extra set of {} but a huge amount of potential to reduce attack surface. A bit more text is worth the insurance.</div><div><br></div><div>ron</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, May 16, 2018 at 8:17 AM Patrick Georgi via coreboot <<a href="mailto:coreboot@coreboot.org">coreboot@coreboot.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi everybody,<br>
<br>
after just running into an issue on the EC code base, I hereby propose that<br>
going forward, we should always wrap conditional blocks in braces, even<br>
one-liners.<br>
That is:<br>
<br>
if (foo) {<br>
   bar();<br>
}<br>
<br>
instead of<br>
<br>
if (foo)<br>
   bar();<br>
<br>
It doesn't hurt too much but saves us from accidentally adding baz() after<br>
bar(), forgetting to add the - now required - braces. If we get rough<br>
consensus over this, I'd change Coding_Style to match.<br>
<br>
<br>
Thoughts?<br>
Patrick<br>
-- <br>
Google Germany GmbH, <a href="https://maps.google.com/?q=ABC-Str.+19,+20354+Hamburg&entry=gmail&source=g">ABC-Str. 19, 20354 Hamburg</a><br>
Registergericht und -nummer: Hamburg, HRB 86891, Sitz der Gesellschaft:<br>
Hamburg<br>
Geschäftsführer: Paul Manicle, Halimah DeLaine Prado<br>
<br>
-- <br>
coreboot mailing list: <a href="mailto:coreboot@coreboot.org" target="_blank">coreboot@coreboot.org</a><br>
<a href="https://mail.coreboot.org/mailman/listinfo/coreboot" rel="noreferrer" target="_blank">https://mail.coreboot.org/mailman/listinfo/coreboot</a></blockquote></div>