|
|
Log in / Subscribe / Register

grsecurity: Teardown of a Failed Linux LTS Spectre Fix

grsecurity: Teardown of a Failed Linux LTS Spectre Fix

Posted Sep 4, 2019 20:35 UTC (Wed) by dezgeg (guest, #92243)
In reply to: grsecurity: Teardown of a Failed Linux LTS Spectre Fix by niner
Parent article: grsecurity: Teardown of a Failed Linux LTS Spectre Fix

I belive the kernel intentionally doesn't use C99 because the ability to declare variables in the middle of a basic block is seen as a bad feature, see for example https://lkml.org/lkml/2012/4/12/18.

(I personally find that forcing declarations to happen at start of blocks is a great way to introduce uninitialized variable-related bugs).


to post comments

grsecurity: Teardown of a Failed Linux LTS Spectre Fix

Posted Sep 4, 2019 22:04 UTC (Wed) by adobriyan (guest, #30858) [Link] (1 responses)

It is one of the silly rules indeed. Writing "for (int i = 0; i < N; i++)" is clearly superior.

grsecurity: Teardown of a Failed Linux LTS Spectre Fix

Posted Sep 9, 2019 23:14 UTC (Mon) by mangix (guest, #126006) [Link]

for (auto i...) is better still. But C++11.

grsecurity: Teardown of a Failed Linux LTS Spectre Fix

Posted Sep 8, 2019 6:06 UTC (Sun) by marcH (subscriber, #57642) [Link]

> (I personally find that forcing declarations to happen at start of blocks is a great way to introduce uninitialized variable-related bugs).

When you use a programming language designed for memory corruption, you want to make the most of it. /s


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds