On 21 September 2013 17:46, wrote: > Is it possible for gcc to produce a > warning in such situation? If ab and bc are 'const' then G++ will warn: o.cc: In function ‘int main()’: o.cc:5:14: warning: integer overflow in expression [-Woverflow] int r = ab * bc; ^ The C compiler still doesn't warn though, due to different rules for how constants are handled between C and C++.