Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Smaller C compiler (Announce)

posted by alexfru(R), USA, 19.06.2016, 00:08

> > > Ah, I had forgotten (since I've never used Plan9) that they were a bit
> > > different. So yeah, perhaps by default they didn't need (or want) a
> > > "full" preprocessor, hence the POSIX environment add-on.
> >
> > I'm not sure what you're talking about.
> "The standard Plan 9 C compilers do not use cpp; they contain their own
> simple but adequate preprocessor, so cpp is usually superfluous."
> "The compilers include an integrated preprocessor that accepts the familiar
> #include, #define for macros both with and without arguments, #undef,
> #line, #ifdef, #ifndef, and #endif. It supports neither #if nor ##,
> although it does honor a few #pragmas. The #if directive was omitted
> because it greatly complicates the preprocessor, is never necessary, and is
> usually abused. Conditional compilation in general makes code hard to
> understand; the Plan 9 source uses it sparingly. Also, because the
> compilers remove dead code, regular if statements with constant conditions
> are more readable equivalents to many #ifs. To compile imported code
> ineluctably fouled by #if there is a separate command, /bin/cpp, that
> implements the complete ANSI C preprocessor specification."

I've read all that before. However, I've missed or forgotten the statement "The compilers include an integrated preprocessor", which may explain certain issues (bugs, etc) in their standalone preprocessor. They simply didn't care much about it and it somehow worked for them in those rare cases they needed it.

As for "perhaps by default they didn't need (or want) a "full" preprocessor, hence the POSIX environment add-on", #if and ## are standard in C and not specific to POSIX. This is why I wasn't sure what you meant.

> > I don't think licenses can travel backwards and then forward again in
> time.
> > The diff between LCC and Plan9 is not GPL'd.
> How big a difference (and advantage) is it? Surely you can handle the
> original (worse code but better license).

The diff is not too big or complex, but I'll have to review it because it seems to also fix a few issues. Right now I'm cleaning up and ANSI-C-fying the original code (duplicate work), so it can compile with a standard compiler and minimally function. Then I'll make further fixes and improvements with a few specific for Smaller C.



Complete thread:

Back to the forum
Board view  Mix view
15297 Postings in 1378 Threads, 254 registered users, 12 users online (0 registered, 12 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum