[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: MIT discovered issue with gcc



On Wed Nov 27, 2013 at 09:04:49, Paul Wise wrote:
> On Wed, Nov 27, 2013 at 6:44 AM, Stefan Roas wrote:
> 
> > Such code has never been valid and any assumption anyone may falsely have
> > on such code is outright wrong. Such code may do anything, which includes
> > nothing so IMHO it's perfectly ok for the optimizer to throw it away.
> > After all we'd be better of not relying on something that is "undefined".
> 
> The problem with that attitude is that it results in C programmers
> never fixing their code and never even knowing that it is wrong
> because the compiler never rejected their code or at the very least
> provided a warning. Not everyone knows everything about C and that is
> why we have compiler warnings. Every use of undefined behaviour should
> at minimum result in a compiler warning.

Point taken. A compiler warning would indeed be nice in those cases.


Reply to: