Re: casting



CBFalconer <cbfalconer@xxxxxxxxx> writes:
[...]
Trying to stuff a value into a signed object that cannot hold that
value results in implementation defined behaviour. You could have
just set off that 3 tons of fertilizer they found in Canada. Only
stuffing into unsigned objects has a defined action.

On a conversion to a signed integer type, if the value cannot be
represented, "either the result is implementation-defined or an
implementation-defined signal is raised". There is no undefined
behavior.

--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.



Relevant Pages

  • Re: casting
    ... just set off that 3 tons of fertilizer they found in Canada. ... stuffing into unsigned objects has a defined action. ...
    (comp.lang.c)
  • Re: casting
    ... just set off that 3 tons of fertilizer they found in Canada. ... stuffing into unsigned objects has a defined action. ...
    (comp.lang.c)
  • Re: casting
    ... just set off that 3 tons of fertilizer they found in Canada. ... stuffing into unsigned objects has a defined action. ... Yes, it's implementation-defined behavior, *not* undefined behavior. ...
    (comp.lang.c)
  • Re: Time For Me To Enter The HD World?
    ... We get tons ... >> of HD hockey in Canada. ... > Lucky you. ...
    (alt.tv.tech.hdtv)
  • Re: SF In A Post-Oil Future
    ... oil deposits, and Canada has two in tar sands. ... There is no reason to encase yourself in three tons of metal ...
    (soc.retirement)