On 10/06/2010 18:07, yuanbin wrote: > This compiler's extension is valuable
No, it isn't very valuable, sorry to be blunt. I think you are following a really wrong path here. You are trying to implement a C++-alike object-oriented system in C. That makes sense as far as it goes, but if you find yourself having to propose modifying the C compiler in a direction that basically makes it speak C++, you might as well just use C++ in the first place. You want the compiler to automatically choose one of several different ways to initialise a union according to the data type of the argument you use to initialise it with; basically, that means you want overloaded constructors. So you should just use C++, which already is C with overloaded constructors. And it also already has all the other features that you'll discover you need in the compiler as you carry along this path. By the time you get to the end of your journey, "coo.h" will be an empty file and all the functionality will have been added to the C compiler until it turns into a C++ compiler. I think you need to choose a different plan. cheers, DaveK