We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I accidentally found this bug that seems to be present in clang++ >= 13.0.0
#include <stdio.h> int main(int argc, char** argv) { if (argc * 2 > 999) printf("WTF?"); while(1); }
main: # @main push rax lea rdi, [rip + .L.str] xor eax, eax call printf@PLT .L.str: .asciz "WTF?"
The compiler removed the if condition above, and considered it to be always true.
This is only present in the C++ compiler, in the C compiler it is producing the correct code.
In GCC and MSVC compilers, this does not happen and produces the correct code.
Is this right? (and by the way, where is while(1)? -- the compiler removed it too? 🤣 )
https://godbolt.org/z/5MWEKrKjz
The text was updated successfully, but these errors were encountered:
Remove the while(1);. The program's behavior is undefined otherwise. You should also return a value from main().
while(1);
main()
Sorry, something went wrong.
Duplicate of: #66307
No branches or pull requests
I accidentally found this bug that seems to be present in clang++ >= 13.0.0
The compiler removed the if condition above, and considered it to be always true.
This is only present in the C++ compiler, in the C compiler it is producing the correct code.
In GCC and MSVC compilers, this does not happen and produces the correct code.
Is this right?
(and by the way, where is while(1)? -- the compiler removed it too? 🤣 )
https://godbolt.org/z/5MWEKrKjz
The text was updated successfully, but these errors were encountered: