home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / std / c / 3298 < prev    next >
Encoding:
Text File  |  1992-12-31  |  1.3 KB  |  30 lines

  1. Newsgroups: comp.std.c
  2. Path: sparky!uunet!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!deccrl!news.crl.dec.com!dbased.nuo.dec.com!e2big.mko.dec.com!jrdzzz.jrd.dec.com!jit533.jit.dec.com!diamond
  3. From: diamond@jit533.jit.dec.com (Norman Diamond)
  4. Subject: Re: pointer comparisons
  5. Message-ID: <C03tzB.BvH@jrd.dec.com>
  6. Sender: usenet@jrd.dec.com (USENET News System)
  7. Nntp-Posting-Host: jit533.jit.dec.com
  8. Reply-To: diamond@jit.dec.com (Norman Diamond)
  9. Organization: Digital Equipment Corporation Japan , Tokyo
  10. References: <1hsdg8INN5jm@urmel.informatik.rwth-aachen.de>
  11. Date: Thu, 31 Dec 1992 03:35:35 GMT
  12. Lines: 16
  13.  
  14. In article <1hsdg8INN5jm@urmel.informatik.rwth-aachen.de> berg@physik.tu-muenchen.de (Stephen R. van den Berg) writes:
  15. >#include <stdlib.h>
  16. >void*a,*b;
  17. >main()
  18. >{ int i;
  19. >  a=malloc(1); b=malloc(1);
  20. >  i+=a>b;
  21.  
  22. [Irrelevant portions of the code deleted to save space.]
  23. The comparison operators are defined under some conditions, always including
  24. that they point into the same object (and/or one element past an array object).
  25. Your a and b point to different objects, so the behavior is undefined.
  26. --
  27. Norman Diamond                diamond@jit.dec.com
  28. If this were the company's opinion, I wouldn't be allowed to post it.
  29. Pardon me?  Or do I have to commit a crime first?
  30.