|
| From: | Simon 'corecode' Schubert |
| Subject: | Re: [Tinycc-devel] 4 bugfixes for Rob Landley's revision 470 |
| Date: | Thu, 06 Sep 2007 01:22:48 +0200 |
| User-agent: | Thunderbird 1.5.0.12 (X11/20070604) |
Rob Landley wrote:
Hmmm, could you give me some more information about the handle_stray_noerror() thing? It seems like rather than special-casing \r\n, we might want to just handle any trailing whitespace after a \ line extender? (This isn't specific to your patch, this is the underlying function being more brittle than I'm comfortable with.)
I think this is a bad idea. \r\n is some sort of broken \n, but " \n" for sure isn't.
Except that doesn't work, naievely because skip_spaces hasn't been declared
yet, but more fundamentally the because skip_spaces() doesn't call inp(), it
calls cinp(). What's cinp()? It's a #define to minp(). (WHY???) And
minp(), of course, is defined as:
static void minp(void)
{
inp();
if (ch == '\\')
handle_stray();
}
Congratulations, we have achieved recursion.
You seem to be grumbling about tcc quite a bit, and I have to say the code isn't close to "nice". Of course that's understandable, considering the origin of the source.
Nevertheless I wonder if it might be a nice educational experience to write a new tcc (or however it would be called) from scratch, using nice function and variable names, a sane scoping (not everything as globals) and broken up into multiple files. Of course that sounds like a lot of work as well :)
cheers simon
| [Prev in Thread] | Current Thread | [Next in Thread] |