☆ Yσɠƚԋσʂ ☆ to Programmer Humor · 2 years agoOptimized Codeimagemessage-square8fedilinkarrow-up127arrow-down14
arrow-up123arrow-down1imageOptimized Code☆ Yσɠƚԋσʂ ☆ to Programmer Humor · 2 years agomessage-square8fedilink
minus-squaredragnucslinkfedilinkarrow-up2·2 years agoTried it on https://www.onlinegdb.com/online_c++_compiler Could not reproduce.
minus-squarePrologue7642@lemmygrad.mllinkfedilinkarrow-up4·2 years agoYou need to use exactly the same command: clang++ loop.cpp -O1 -Wall -o loop this page likely doesn’t use clang but GCC, so it won’t work.
minus-square☆ Yσɠƚԋσʂ ☆OPlinkfedilinkarrow-up3arrow-down2·2 years agook yeah didn’t work on my machine either edit: interestingly enough seems to work on some architectures and not others, a friend of mine tried it and it worked for him. I guess that’s why it’s an undefined behvaior. :)
Tried it on https://www.onlinegdb.com/online_c++_compiler Could not reproduce.
You need to use exactly the same command:
clang++ loop.cpp -O1 -Wall -o loop
this page likely doesn’t use clang but GCC, so it won’t work.ok yeah didn’t work on my machine either
edit: interestingly enough seems to work on some architectures and not others, a friend of mine tried it and it worked for him. I guess that’s why it’s an undefined behvaior. :)