home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19426 < prev    next >
Encoding:
Internet Message Format  |  1993-01-08  |  1.3 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!news.service.uci.edu!beckman.com!dn66!a_rubin
  2. Newsgroups: comp.lang.c
  3. Subject: Re: applying or
  4. Message-ID: <a_rubin.726512278@dn66>
  5. From: a_rubin@dsg4.dse.beckman.com (Arthur Rubin)
  6. Date: 8 Jan 93 16:57:58 GMT
  7. References: <1993Jan1.184655.7023@viewlogic.com> <1993Jan06.002044.795@microsoft.com>
  8. Organization: Beckman Instruments, Inc.
  9. Nntp-Posting-Host: dn66.dse.beckman.com
  10. Lines: 28
  11.  
  12. In <1993Jan06.002044.795@microsoft.com> russpj@microsoft.com (Russ Paul-Jones) writes:
  13.  
  14.  
  15. >So, there are some instances where this optimization might be made:
  16.  
  17. >b = 4;
  18. >if (a*7)/3 > 100/a || b
  19. >    fred();
  20.  
  21. >I would say that fred() may be called without evaluating the silly 
  22. >expression, even if a == 0.  But I would suspect that it would take 
  23. >a fairly clever compiler to safely find many of these instances.
  24.  
  25. I don't think so.  (Well, in this example, it's permitted, as the
  26. expression has no side effects except divide-by-0, the results of which are
  27. undefined, but...)
  28.  
  29. b = 4;
  30. if (a*7)/3 > 100/a++ || b
  31.     fred();
  32.  
  33. is a different matter.
  34.  
  35. --
  36. Arthur L. Rubin: a_rubin@dsg4.dse.beckman.com (work) Beckman Instruments/Brea
  37. 216-5888@mcimail.com 70707.453@compuserve.com arthur@pnet01.cts.com (personal)
  38. My opinions are my own, and do not represent those of my employer.
  39. My interaction with our news system is unstable; please mail anything important.
  40.