r/C_Programming • u/Low_Minimum9920 • Jun 15 '26
Question Question regarding unsigned integers
What's the difference between an unsigned int and a normal integer?
11
Upvotes
r/C_Programming • u/Low_Minimum9920 • Jun 15 '26
What's the difference between an unsigned int and a normal integer?
View all comments
Show parent comment
1
u/StaticCoder Jun 16 '26
The compiler is free to eliminate the
foo()call in this code, and yes it's something that happens:Signed overflow being undefined has real consequences, which is why it stays undefined, because defining it would break useful optimizations.