home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / mac / programm / 20577 < prev    next >
Encoding:
Internet Message Format  |  1993-01-03  |  2.0 KB

  1. Xref: sparky comp.sys.mac.programmer:20577 comp.sys.mac.oop.misc:152
  2. Path: sparky!uunet!spool.mu.edu!sdd.hp.com!cs.utexas.edu!tamsun.tamu.edu!tamsun.tamu.edu!news
  3. From: bpb9204@tamsun.tamu.edu (Brent Burton)
  4. Newsgroups: comp.sys.mac.programmer,comp.sys.mac.oop.misc
  5. Subject: Re: David Betz and Bob Language
  6. Date: 3 Jan 1993 20:42:29 -0600
  7. Organization: Texas A&M Univ., Inc.
  8. Lines: 41
  9. Message-ID: <1i886lINNg1v@tamsun.tamu.edu>
  10. References: <01050133.mp32gx@distant.uucp>
  11. NNTP-Posting-Host: tamsun.tamu.edu
  12.  
  13. edw@distant.uucp writes:
  14. |
  15. |It's written in K&R C, and does wierd things with function arguments. For
  16. |instance, it'll define a function like this:
  17. |
  18. |do_expr()
  19. |{ [...] }
  20. |
  21. |and then call it with arguments! You don't do things like this in ANSI C,
  22.  
  23. Welcome to the weird, wild, wooly world of RealWorld Programming!
  24. I'm not trying to belittle you in any way, but I've just seen *so many*
  25. programs with code like this -- and they still work.  Amazing.
  26.  
  27. As you delve deeper into the worlds of other hacker's code, you'll see
  28. more and more weird things (like passing 12 arguments to a function just
  29. because the programmer didn't use variable argument lists - ala GNU Bison -
  30. and then only using 3 in common usage.  You'd think these guys never heard
  31. of a parameter block or data structures before, but I digress.)
  32.  
  33. |3. Knows what the hell is happening with the stuff I described above.
  34.  
  35. Well, the stuff, for the most part, will work, but I can't put too much
  36. confidence into code that uses anticonventions like your above example.
  37.  
  38. The trick to getting it to compile with Think C 5 is to turn off some
  39. of the Think C extensions, mainly the prototype inferencing and strict
  40. type checking.  I've found this to work with most codes.
  41.  
  42. However, if the code just doesn't run, you better plan to spend some
  43. serious time editing the code to make it ANSI-compliant.  This is
  44. tedious.
  45.  
  46. Good luck, and your ideas sound good.  Keep us all posted.
  47.  
  48. -Brent
  49. -- 
  50. +-------------------------+
  51. | Brent Burton    N5VMG   |    
  52. | bpb9204@tamsun.tamu.edu |  
  53. +-------------------------+ 
  54.