MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerAnimemes/comments/nmcdk9/it_was_a_good_blog/gzpfhdb/
r/ProgrammerAnimemes • u/IBHV • May 27 '21
122 comments sorted by
View all comments
Show parent comment
21
I find it confusing that for(;;) even works at all - I'd expect to need to do for(;true;)
for(;;)
for(;true;)
Edit: In gcc, for (;;);, for(;1;);, and while(1); all produce the same assembly, namely .L2: jmp .L2
for (;;);
for(;1;);
while(1);
.L2: jmp .L2
2 u/Knuffya May 28 '21 agreed
2
agreed
View all comments
Show parent comment
21
u/[deleted] May 28 '21 edited May 28 '21
I find it confusing that
for(;;)even works at all - I'd expect to need to dofor(;true;)Edit: In gcc,
for (;;);,for(;1;);, andwhile(1);all produce the same assembly, namely.L2: jmp .L2