Post ASZmravOMSNCvPwGuG by elfprince13@mumak.app
(DIR) More posts by elfprince13@mumak.app
(DIR) Post #ASUYpPU9Q5BrafZQzQ by dev@discuss.systems
2023-02-09T00:19:45Z
3 likes, 4 repeats
Shot, Chaser
(DIR) Post #ASVL8DOrN9ZnPV81JI by mx00s@mastodon.social
2023-02-09T00:36:50Z
0 likes, 0 repeats
@dev but...why??
(DIR) Post #ASVL8E2YzXKrOdhjCC by isagalaev@mastodon.social
2023-02-09T00:40:21Z
0 likes, 0 repeats
@mx00s @dev yes! WTF?
(DIR) Post #ASVL8EksKmmTc4R7GS by gordio@mastodon.social
2023-02-09T01:33:30Z
0 likes, 0 repeats
@isagalaev hm… maybe ‘unreachable’ is clang hardcoded function name that will be called in case of infinity loop is happened? 🤨
(DIR) Post #ASVL8FM66OYTTVqqHY by unlambda@hachyderm.io
2023-02-09T02:56:08Z
0 likes, 0 repeats
@gordio @isagalaev no, you can change the name of the second function to anything you want. In fact, because this is C++ the name gets mangled, so the actual compiled name is not "unreachable"You can use the compiler explorer to see, clang/LLVM just treats the infinite loop as undefined behavior, so it just deletes it. Thus the body of "main" is empty, and control just continues on to the following code in "unreachable".https://godbolt.org/z/nPzWzbvb7
(DIR) Post #ASVL8GSryhZAuo1lTc by Archivist@social.linux.pizza
2023-02-09T13:34:22Z
0 likes, 0 repeats
@unlambda @gordio @isagalaevYes, empty infinite loops are undefined behaviour and anything could happen, and hence does happen
(DIR) Post #ASVL8I0aEq81heoCfI by gordio@mastodon.social
2023-02-09T01:40:37Z
0 likes, 0 repeats
https://sourcegraph.com/github.com/llvm/llvm-project/-/blob/llvm/include/llvm/Support/ErrorHandling.h
(DIR) Post #ASZmrAHnP3FeJ5DHZw by elfprince13@mumak.app
2023-02-09T01:10:15Z
1 likes, 0 repeats
@dev does the compiler say anything with -Wextra?
(DIR) Post #ASZmrAsJDISU8KIRUW by dev@discuss.systems
2023-02-09T01:13:02Z
1 likes, 0 repeats
@elfprince13
(DIR) Post #ASZmravOMSNCvPwGuG by elfprince13@mumak.app
2023-02-09T01:13:45Z
0 likes, 0 repeats
@dev o_O
(DIR) Post #ASZmrbZ5yq8GuYVynA by elfprince13@mumak.app
2023-02-09T01:18:41Z
0 likes, 0 repeats
@dev oh I see you have a type error that for some reason the compiler is ignoring. Try -Werror=return-type ?
(DIR) Post #ASZmrcHPK5Zt7zFMrQ by dev@discuss.systems
2023-02-09T01:21:54Z
1 likes, 0 repeats
@elfprince13 nope still nothing
(DIR) Post #ASZmruH0QJx4vxCIjY by elfprince13@mumak.app
2023-02-09T01:28:23Z
1 likes, 0 repeats
@dev Oh - I guess that’s not firing because the *compiler* looks at the control flow and says “you don’t actually reach the closing brace” and then something is happening lower down in LLVM to delete the loop?
(DIR) Post #ASZmsCde8sl1tNvdWS by dev@discuss.systems
2023-02-09T01:32:04Z
1 likes, 0 repeats
@elfprince13 working theory is the since the ub loop is optimized out, somehow it keeps going beyond main