home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / gnu / misc / discuss / 2959 < prev    next >
Encoding:
Text File  |  1992-09-08  |  2.0 KB  |  50 lines

  1. Newsgroups: gnu.misc.discuss
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!jvnc.net!primerd.prime.com!nt1l!nt1l!aardvark
  3. From: aardvark@nt1l.krl.com (Donald Koch)
  4. Subject: Re: Gripe with Bison code (and a suggested fix...)
  5. Message-ID: <1992Sep9.020401@nt1l.krl.com>
  6. Sender: aardvark@nt1l (Donald Koch)
  7. Nntp-Posting-Host: nt1l
  8. Organization: Koch Research Labs
  9. References:  <1992Sep9.041540.10477@tamsun.tamu.edu>
  10. Date: Wed, 9 Sep 1992 06:04:01 GMT
  11. Lines: 37
  12.  
  13. In article <1992Sep9.041540.10477@tamsun.tamu.edu>, bpb9204@tamsun.tamu.edu (Brent) writes:
  14. > I have a problem with some of the Bison code (version 1.18).  Not the
  15. > generated code, but bison's source.
  16. > For instance, here is a little jewel of coding wizardy.  It can be also
  17. > labeled as, "how to do variable args when you don't know how."
  18.  
  19. More correctly, "how to do variable args when the compiler can't."  Remember,
  20. not all C compilers are created equal.
  21.  
  22. > This is totally ridiculous!  Of course, my compiler is probably the only one
  23. > that chokes on this (because x1-x8 have no type declared), but that's 
  24. > irrelevant.  This coding style is what gives C such a bad name (OK,
  25. > *one* of the things), not to mention all the extra parameters that
  26. > have to be passed to sprintf every time it's called, even if they are zero.
  27.  
  28. C has a good name? :-)  If you think this is a bad example, wander over to
  29. alt.sources; the winners of the '92 C Obfuscation Contest just got posted.
  30.  
  31. > Here is the fixed code:
  32. [...]
  33.  
  34. You might try throwing in a few #ifdef's for those compilers that can't handle
  35. varargs but can handle the extra arguments.
  36.  
  37. > I am going to go through and fix this function throughout the source.  
  38. > I am willing to distribute the fixed code, provided the FSF, et al will
  39. > accept code modifications from a Macintosh. 
  40.  
  41. Hmmm... I'll consider it. :-)  (Not like they would ever consider my opinion
  42. worth anything.)  I'm sure there is a note in one of the README/ChangeLog/whatever
  43. files stating where to send suggested fixes.
  44. -- 
  45. Don Koch
  46. aardvark@nt1l.krl.com
  47.