☆ Yσɠƚԋσʂ ☆@lemmy.ml to Programmer Humor@lemmy.ml · 2 years agoOptimized Codelemmy.mlimagemessage-square7fedilinkarrow-up112arrow-down13
arrow-up19arrow-down1imageOptimized Codelemmy.ml☆ Yσɠƚԋσʂ ☆@lemmy.ml to Programmer Humor@lemmy.ml · 2 years agomessage-square7fedilink
minus-squaredragnucs@lemmy.mllinkfedilinkarrow-up0·2 years agoTried it on https://www.onlinegdb.com/online_c++_compiler Could not reproduce.
minus-squarePrologue7642@lemmygrad.mllinkfedilinkarrow-up1·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σɠƚԋσʂ ☆@lemmy.mlOPlinkfedilinkarrow-up1arrow-down1·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. :)