Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
JS96184542yI would love to believe it, but it seems impossibile, unless you didn't include something else in the condition or inside the if.
-
dmonkey21952y@JS96 I swear, I spent a whole day around it. Refactoring solved the problem.
Probably messed up something with JIT or some sort of caching. -
I saw a bug in gcc where it would freeze building clang forever and use full cpu while doing it
-
@dmonkey
C++ doesn't JIT.
At least not if you are not using profile-guided optimization, which is not quite JIT anyway.
There are shenanigans that can be made to make cout do bullshit like that. Just to check, I'd do
std::cout << vec.size() == 0;
If that does print true, then I'd worry.
Otherwise, something shadowed ostream& operator<<(ostream&, int&);, something defined cout locally (note you are not using std::), or there are macro shenanigans. -
dmonkey21952y@CoreFusionX doesn't clang have some kind of jit? I recall something tbh, but if you say so I do belive you.
At the time I was working with llvm passes. I was building one.
It was just one single class, with one single method of interest where everything was both created and destroyed there.
No external stuff besides the stdlib.
(The bug was in the pass itself, not the IR)
Related Rants
-
fzammetti5Craziest bug, not so much in the sense of what it was (although it was itself wacky too), but in what I went t...
-
WildOrangutan7If user was on the right screen, and if random error dialog happened to show, it would delete his account. Fo...
-
coditect5My boss back in 2013 asked me to figure out why he was getting birthday notifications from his pet social medi...
I ranted about it already.
```c++
if (vec.size() > 0) { // or whatever
cout << vec.size();
// ....
}
```
Its output was zero. And before you ask, it was a single thread program.
Aince it was for my thesis and I was in a hurry I didn't care too much for it.
Yet I think that it was a bug in clang. I removed that piece of code, compiled, rewritten it a bit differently and worked as expected. Never looked back.
rant
wk351