@vaporeon_ this compiles and prints "hello world" :clodsire_head:​:clodsire_tail:​

#include <iostream>
int main() { while (1); }
void unreachable() { std::cout << "Hello, world!\n"; }

@wallhackio Not when I compile with g++ 15 on Linux :psyduck:

But think I've heard of the concept, that because infinite loops are ¿undefined behaviour?, it might execute whatever is after them... How to prevent it?

@wallhackio Does it work for you? Maybe I need a different compiler...

@wallhackio @vaporeon_ i've been trying to work it out and my best guess is it separately deems main nonreturning, eliding the coda, and then still wholly removes the bodyless infinite loop for ¿some reason? so that it falls through

Sign in to participate in the conversation
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.