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

Re: Please don't do this (code fragment)




> This is not to excuse the code in any way; it's lame. I just think that
> this discussion is focusing too much on what standards documents say,
> and not enough on what actually happens in the real world. I don't think
> it's at all likely that future versions of gcc (or other well-known
> compilers) will crash on integer overflow; reliance on overflow from
> INT_MAX to INT_MIN is sufficiently common in C code that I think any
> compiler that did not handle it well would be considered unusable.
> 

Well, just like -ansi isn't for everyone, -checked-ints wouldn't be,
either.  However, that doesn't mean people won't want to use integer
bounds-checking in a C compiler if they had one!  In particular, a lot
of C code isn't really system code -- it's application code that was
originally written in C because C was easily available at the time.



-Lex



Reply to: