TCC can only compile C. If it were to be able to compile C++, it would need a lot more work (it would need to compile C++ language features: classes, templates, etc. etc.). Since it's still rather buggy at being a C compiler, extending it to compile C++ probably wouldn't be very helpful. Secondly, C++ is not a superset of C. It is more like an extension of C. C++ made some changes to the semantics of the C bits (for example, implicit casts of void pointers) which were necessary for other features of C++ to work. So, it is not true that *any* C program is a valid C++ program, although some are (i.e. there is a large common subset).
On Wednesday 15 April 2009 13:11:08 lostgallifreyan wrote: > Joshua Phillips <[email protected]> wrote: > (15/04/2009 13:46) > > >stricmp or strcasecmp would be provided by the C library. Tcc is only a > >compiler - it doesn't include a C library. Therefore, the presence of > > stricmp or strcasecmp will be determined by the C library you're using > > (GNU libc or MSVCRT or other) > > Ok, that makes sense, but if it were only the library that determines > what's there, TCC might compile C++. As it doesn't I assume it's not just > the library that determines this. (That remark is based in my possibly > erroneous assumption that C++ is a kind of superset of C with a lot more > dedicated functions). In short, doesn't the compiler have to 'understand' > what it's compiling? > > > > _______________________________________________ > Tinycc-devel mailing list > [email protected] > http://lists.nongnu.org/mailman/listinfo/tinycc-devel
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Tinycc-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/tinycc-devel
