User: Password:
|
|
Subscribe / Log in / New account

would using casts fix the problem?

would using casts fix the problem?

Posted Apr 17, 2008 18:55 UTC (Thu) by hummassa (subscriber, #307)
In reply to: would using casts fix the problem? by MathFox
Parent article: GCC and pointer overflows

yes,
  aend - a
(without cast) _is_ 10 in any platform, but
  (int)aend - (int)a
is _undefined_ behaviour, because the bit pattern when converting from 
pointer to int is implementation-defined.


(Log in to post comments)


Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds