[Intel-gfx] [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr
Linus Torvalds
torvalds at linux-foundation.org
Mon Feb 28 20:10:24 UTC 2022
On Mon, Feb 28, 2022 at 12:03 PM Linus Torvalds
<torvalds at linux-foundation.org> wrote:
>
> Side note: we do need *some* way to do it.
Ooh.
This patch is a work of art.
And I mean that in the worst possible way.
We can do
typeof(pos) pos
in the 'for ()' loop, and never use __iter at all.
That means that inside the for-loop, we use a _different_ 'pos' than outside.
And then the compiler will not see some "might be uninitialized", but
the outer 'pos' *will* be uninitialized.
Unless, of course, the outer 'pos' had that pointless explicit initializer.
Here - can somebody poke holes in this "work of art" patch?
Linus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-patch
Size: 1927 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gfx/attachments/20220228/92bce193/attachment-0001.bin>
More information about the Intel-gfx
mailing list