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

Re: MIT discovered issue with gcc



On Tue, Nov 26 2013, Paul Wise <pabs@debian.org> 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.

I think this is a very good point.  This is a perfect example of where
compile warnings would be really really useful.

jamie.

Attachment: pgpAItuR3VfI3.pgp
Description: PGP signature


Reply to: