home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lclint.zip / lclint-2_3h-os2-bin.zip / test / argorder4.c < prev    next >
Text File  |  1997-09-03  |  483b  |  40 lines

  1. int glob;
  2.  
  3. int add(int x, int y) { return (x + y); }
  4.  
  5. int f()
  6. {
  7.   return (glob);
  8. }
  9.  
  10. int g()
  11. {
  12.   return (++glob);
  13. }
  14.  
  15. int h()
  16. {
  17.   if (f() > 3)
  18.     {
  19.       return (f() + g()); /* bad --- order of evaluation matters! */
  20.     }
  21.   else
  22.     {
  23.       if (g() < 2)
  24.     {
  25.       return (f() + (++glob)); /* bad! */
  26.     }
  27.       else
  28.     {
  29.       return (g() + h()); /* bad (twice) */
  30.     }
  31.     }
  32.   
  33.   /* unreachable code here */
  34.  
  35.   return (add ((printf("hullo"), 3), (printf("goodbye"), 4))); /* bad (wrice) */
  36. }
  37.  
  38.  
  39.  
  40.