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, 04.09.2015, 07:22

> (BTW, sorry for procrastinating and not testing this sooner. You've done
> very good work!)

Thanks! Nice to hear someone's at least trying it out. :)

> > I've added an option (-ppg) to smlrcc to invoke gcc as a preprocessor
> and
> > included the va_* macros in stdarg.h.
> > This should help until there's a decent preprocessor in Smaller C.
> >
> > It looks like DJGPP's gcc.exe works as well.
>
> It looks like you're using "-nostdinc -isystem". Why not just use "-I"
> instead since it prepends your dir before searching the other typical
> standard system header places. (GCC online manuals):
> -I,
> -isystem

Smaller C does not support all of the C language (that applies to the library as well) and the compiler proper uses a fixed amount of memory to keep track of declarations and symbols. It is unlikely that some random stuff pulled in from, say, DJGPP include directories (by mistake or intentionally) will do much good. So, the location of system headers is overridden to prevent mixing and matching system headers, especially while having these limitations.

> Also, you should probably also use "-U__GNUC__" since some macros may
> depend on it. (For instance, I was optionally using case ranges #if defined
> _GNUC__ || defined __TINYC__ , e.g. "case 'a' ... case 'z':".) In other
> words, if you don't do this and use GCC as preprocessor, SmallerC will
> choke on faulty code.

Maybe. Right now you can depend on __SMALLER_C__ for stuff that's intended for Smaller C and when it's not defined do something else for gcc or another compiler. Given the above limitations, you still pretty much have to write specialized code for Smaller C, in which case checking first for __SMALLER_C__ isn't that much different from checking for __GNUC__ and the like.

Thanks!

 

Complete thread:

Back to the forum
Board view  Mix view
15108 Postings in 1358 Threads, 247 registered users, 14 users online (1 registered, 13 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum