Re: Null references.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pete Becker

    #1

    Re: Null references.

    On 2008-07-15 23:04:29 -0400, "Alf P. Steinbach" <alfps@start.no said:
    >
    There are some exceptions to incurring UB for dereferencing a
    nullpointer. The most important one is that any given compiler vendor
    can decide to give that a well-defined meaning at compile time for that
    compiler, and exploit that to implement various macros in the standard
    library.
    That is not an exception to the meaning of undefined behavior. The
    language definition says that certain things result in undefined
    behavior, and that means that the language definition doesn't tell you
    what those things do. The possiblity that a particular compiler vendor
    makes some of those things well defined doesnt change the fact that the
    language definition doesn't impose requirements. The behavior is still
    undefined.

    --
    Pete
    Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
    Standard C++ Library Extensions: a Tutorial and Reference
    (www.petebecker.com/tr1book)

  • Pete Becker

    #2
    Re: Null references.

    On 2008-07-16 17:36:59 -0400, "Alf P. Steinbach" <alfps@start.no said:
    * Pete Becker:
    >On 2008-07-15 23:04:29 -0400, "Alf P. Steinbach" <alfps@start.no said:
    >>
    >>>
    >>There are some exceptions to incurring UB for dereferencing a
    >>nullpointer . The most important one is that any given compiler vendor
    >>can decide to give that a well-defined meaning at compile time for that
    >>compiler, and exploit that to implement various macros in the standard
    >>library.
    >>
    >That is not an exception to the meaning of undefined behavior. The
    >language definition says that certain things result in undefined
    >behavior, and that means that the language definition doesn't tell you
    >what those things do. The possiblity that a particular compiler vendor
    >makes some of those things well defined doesnt change the fact that the
    >language definition doesn't impose requirements.
    >
    Agreed, up till this point. I was talking about incurring UB and
    you're talking about the meaning of UB.
    I don't know what "incurring UB" means. The standard simply says that
    the behavior of the program is undefined, not that anyting incurs
    anything.
    >
    >
    >The behavior is still undefined.
    >
    No, of course it isn't: it's then only undefined with respect to the standard.
    >
    It may do what some implementor says it does. That doesn't change the
    fact that it's undefined behavior. If you're using the term "undefined
    behavior" to mean something other than what the standard says it means,
    you need to say so.

    --
    Pete
    Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
    Standard C++ Library Extensions: a Tutorial and Reference
    (www.petebecker.com/tr1book)

    Comment

    Working...