3 ms·
Is it normal kernel style to use if blocks without braces if it's only one line? See https://github.com/davidmalcolm/antipatterns.ko/blob/main/bug.c#L28 https:/
by cratermoon 5y ago
Is it normal kernel style to use if blocks without braces if it's only one line? See https://github.com/davidmalcolm/antipatterns.ko/blob/main/bug.c#L28 https://github.com/davidmalcolm/antipatterns.ko/blob/main/bu...
- zamadatix 5y agoFrom https://www.kernel.org/doc/html/v4.10/process/coding-style.html https://www.kernel.org/doc/html/v4.10/process/coding-style.h... "Do not unnecessarily use braces where a single statement will do."
- cratermoon 5y agoI wonder if anyone has done an analysis of kernel code to find all the cases where brace-less statements introduced bugs.
- guenthert 5y agoIt's C, not Perl. The Linux kernel is not the best place to start with programming.
- ToFab123 5y agoApples famous "gotofail" SSL Security Bug was due to this https://embeddedgurus.com/barr-code/2014/03/apples-gotofail-ssl-security-bug-was-easily-preventable/ https://embeddedgurus.com/barr-code/2014/03/apples-gotofail-...