cisc
@cisc
Followers
176
Following
13
Media
41
Statuses
2K
このコード、最適化をかけるとgccでもclangでも結果が壊れるんだけどC言語的におかしいところないよね?. Compiler Explorer @CompileExploreより.
godbolt.org
int main(void) { for (int i = 0; i < 20; i++) { int32_t a=rand() * 2; int32_t b=rand() * 2; int32_t c=a> b ? b : a; int32_t d = (int32_t)(a - b) > 0 ? b : a; printf("%08x %08x %08x %08x...
1
0
4