Re: C Standard Regarding Null Pointer Dereferencing



Shao Miller wrote:

*(char *)0

(C) "Address and indirection operators", 6.5.3.2, Semantics 4:

"...if [the operand] points to an object,
the result is an lvalue designating the object."


What does the standard say that the result is,
if the operand doesn't point to an object?


Is there undefined behaviour?

What do you think?



--
pete
.



Relevant Pages

  • Integers (was: Decimal Arithmetic
    ... mathmatics) BUT that within programming languages, it may become ... definition of integers within the ISO 2002 COBOL Standard (with NO claim that ... When the term 'integer' is used as a constraint for an operand in a syntax ... My assumption is that the ISO Standards for Fortran and ...
    (comp.lang.pl1)
  • Re: Null terminated strings: bad or good?
    ... This should apply when the operand of sizeof is such that the result ... Nothing in the standard prohibits ...
    (comp.std.c)
  • Re: operators similar to functions?
    ... Of course Harbison & Steele could be wrong, or the standard may ... The first one has 'a' as it's left operand, ... each additive expression have as it's value the sum of it's operands. ... thing that breaks the associativity of computer addition. ...
    (comp.lang.c)
  • Re: C Test Incorrectly Uses printf() - Please Confirm
    ... Imagine a world in which operand evaluation order was standardized, ... Now we might lose speed in translation, since each operand must have its dependencies on any previous operands noted and properly processed. ... For a left-to-right standard order, this would mean that the third operand above would have to have its read of 'a' scheduled for after the modification of 'a'. ... It seems that those responsible for that portion of the draft perceive a value in distinguishing between the two. ...
    (comp.lang.c)
  • Re: move of COMP to DISPLAY
    ... The way that I read the '02 Standard, starting, ... "If the usage of the sending operand is different from that of the receiving ... sending operand to the internal representation of the receiving operand takes ... 01 comp-item pic 99 COMP. ...
    (comp.lang.cobol)