Re: Amazon used lisp & C exclusively? (clc,cll)



goose said:


Richard Heathfield wrote:
goose said:

<snip>

Anyway, C&V from my copy of n869, 6.3.2.3 (Pointers):
"[#5] An integer may be converted to any pointer type. |
Except as previously specified, the result is
implementation-defined, might not be properly aligned, and
might not point to an entity of the referenced type"

Yes, the result of the conversion is implementation-defined. The result
of dereferencing the resulting pointer, however, is undefined. (But it
can be useful nevertheless, as hitherto acknowledged.)


I hate to be bothersome, but I don't suppose you have
C&V for that?

If a ``shall'' or ``shall not'' requirement that appears outside of
a constraint is violated, the behavior is undefined. Undefined
behavior is otherwise indicated in this Standard by the words
``undefined behavior'' or by the omission of any explicit definition
of behavior. There is no difference in emphasis among these three;
they all describe ``behavior that is undefined.''

I claim that the Standard omits any explicit definition of behaviour, and
therefore the behaviour is undefined. If you can show that I'm wrong, feel
free.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
.



Relevant Pages

  • Re: Amazon used lisp & C exclusively? (clc,cll)
    ... Richard Heathfield wrote: ... "An integer may be converted to any pointer type. ... the result of the conversion is implementation-defined. ...
    (comp.lang.c)
  • Re: why use fprintf / size_t instead of printf/ int
    ... I could not find the original question either, ... The base address is of a pointer type, ... likely to be the the same size as a size_t, but whether any conversion ... size_t should be converted than int. ...
    (comp.lang.c)
  • Re: Memory Overcommit issue under c++
    ... you are may be using the wrong cast operator here and what ... imply that the void * has the same representation as the casted-to ... pointer type, which, while usually true in practice, is not (at least ... The purpose of a type conversion is to convert a value from one type ...
    (comp.os.linux.development.system)
  • Re: Type safety
    ... There's no conversion from a floating-point to pointer type ... - a type compatible with the effective type of the object, ... aforementioned types among its members (including, ...
    (comp.lang.c)
  • Re: Amazon used lisp & C exclusively? (clc,cll)
    ... goose said: ... "An integer may be converted to any pointer type. ... the result of the conversion is implementation-defined. ...
    (comp.lang.c)