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