> On Jan 30, 2017, at 8:05 AM, Bob Supnik <b...@supnik.org> wrote:
> 
> ...
> Converting sim_step to uint32 should quiesce compilers that are fussy about 
> integer overflow or wraparound on variable i. 

It would be good to make that change, because according to the C standard, 
overflow is undefined on signed data types.  So compiler can (and some 
definitely do) make optimizations based on overflow not being allowed.  
Conversely, unsigned types do allow overflow (wrap).  So in cases where you 
want that, the standard says you have to use an unsigned type.

C is a mess... this is just one example, where two unrelated properties 
(wrapping and signedness) are tied together by the language rules.

        paul


_______________________________________________
Simh mailing list
Simh@trailing-edge.com
http://mailman.trailing-edge.com/mailman/listinfo/simh

Reply via email to