To me, there is no need to write a new compiler for that. A preprocessor is enough (remember that first Barnes C++ compiler, at least until 2.0, was a pre-processor)
The benefit of pre-processor is that it can be used with other C compilers. [email protected] may want to add more syntactic sugar and extend his preprocessor with, say, position independent arguments void copy(void*dest, const void*src, int deepcopy=0); copy(src: s, dest: d); C. From: [email protected] [mailto:[email protected]] On Behalf Of David Mertens Sent: lundi 20 février 2012 15:13 To: [email protected] Subject: Re: [Tinycc-devel] tcc optional argument as in C++ I agree with Christian. However, if the need is great, why not write your own compiler that uses libtcc and handles that preprocessing for you? You could copy the current tcc.c and modify it in a handful of places and you'd have your own derived compiler. Note that I'm not suggesting that you fork tcc and hack on this feature. Rather, start a new project that clearly depends on and derives from tcc/libtcc which has just the .c file and a Makefile. A tcclet, so to speak. :-) David On Mon, Feb 20, 2012 at 8:06 AM, Christian Jullien <[email protected]> wrote: As long as my opinion matters, I prefer to reserve C++ features to C++ compilers. In order to keep tcc small and simple, I prefer to stick to C only features. I think it's better to implement C11 features than to hack few C++ goodies. M2c Christian -----Original Message----- From: [email protected] [mailto:tinycc-devel-bounces+eligis <mailto:tinycc-devel-bounces%2Beligis> [email protected]] On Behalf Of [email protected] Sent: lundi 20 février 2012 14:37 To: [email protected] Subject: [Tinycc-devel] tcc optional argument as in C++ Hi, i want/need to have optional argument declared inside the function prototype only. I have two options for doing it. Write a preprocessor that does the mod or modify the Tcc preprocessor and adding a commandline switch to it in order to accept the relaxed parsing or if you think, eventually without commandline switch. What solution do you prefer that i implement ? _______________________________________________ Tinycc-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/tinycc-devel _______________________________________________ Tinycc-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/tinycc-devel -- "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." -- Brian Kernighan
_______________________________________________ Tinycc-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/tinycc-devel
