Re: [Tinycc-devel] Please support coo.h

2010-06-12 Thread shinichiro . h
Hi, i have pushed the patch on mob Coo: initial last member of union Please change my name of patch: U-YUAN\Administrator - yuanbin This change broke #include math.h on my Debian Linux. % ~/wrk/tinycc/tcc math.c In file included from math.c:1: In file included from /usr/include/math.h:34:

Re: Please support coo.h

2010-06-11 Thread yuanbin
I am familiar with C++, Do not recommend C++ to me. gcc initial the first member of union now, This is not the C standard also. I just want gcc initial the last member of union with some switch. 2010/6/11 Magnus Fromreide ma...@lysator.liu.se: On Fri, 2010-06-11 at 08:44 +0800, yuanbin wrote:

Re: Please support coo.h

2010-06-11 Thread Paolo Bonzini
On 06/11/2010 10:15 AM, yuanbin wrote: gcc initial the first member of union now, This is not the C standard also. I just want gcc initial the last member of union with some switch. Why do you want the last one? Is there a compiler that does that (e.g. MSVC++)? If yes, it can be toggled by

Re: [Tinycc-devel] Please support coo.h

2010-06-11 Thread yuanbin
i have pushed the patch on mob Coo: initial last member of union Please change my name of patch: U-YUAN\Administrator - yuanbin 2010/6/11 grischka gris...@gmx.de: Too all: Please push patches on our mob branch:  http://repo.or.cz/w/tinycc.git People who don't like/know git: at least base

Please support coo.h

2010-06-10 Thread yuanbin
Coo - C, Object Oriented http://sourceforge.net/projects/coo/ -coo.h-- #ifndef __COO_H__ #define __COO_H__ typedef struct VTable /*root of virtual table class*/ { long offset; /*servers for FREE*/ } VTable; #define EXTENDS(s) \ union \ { \ s s; \

Re: Please support coo.h

2010-06-10 Thread Paolo Bonzini
On 06/10/2010 10:57 AM, yuanbin wrote: initialization of the enum: you mean union. enum { int i; float f; } t={1.5}; //t.f The above makes no sense, what if you have int and char? You have to say union { ... } t = { .f = 1.5 }; and that already works in

Re: Please support coo.h

2010-06-10 Thread yuanbin
-- initialization of the union: union { int i; float f; } t={1.5}; //t.f because of EXTENDS2 in coo.h, compiler needs to initialze last member of union. #include coo.h typedef struct VBase {} VBase; typedef struct CBase { VT(VBase) int i; } CBase; typedef

Re: Please support coo.h

2010-06-10 Thread yuanbin
initialization of global variable? 2010/6/10 Andreas Schwab sch...@redhat.com: yuanbin yuanb...@gmail.com writes: but i want default format: CThis t={0, 1, 1}; //simple Define a suitable constructor. Andreas. -- Andreas Schwab, sch...@redhat.com GPG Key fingerprint = D4E8 DBE3 3813

Re: Please support coo.h

2010-06-10 Thread Andreas Schwab
yuanbin yuanb...@gmail.com writes: but i want default format: CThis t={0, 1, 1}; //simple Define a suitable constructor. Andreas. -- Andreas Schwab, sch...@redhat.com GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E And now for something completely different.

Re: Please support coo.h

2010-06-10 Thread Wojciech Meyer
On Thu, Jun 10, 2010 at 2:10 PM, yuanbin yuanb...@gmail.com wrote: initialization of global variable? No, just define a macro. 2010/6/10 Andreas Schwab sch...@redhat.com: yuanbin yuanb...@gmail.com writes: but i want default format: CThis t={0, 1, 1}; //simple Define a suitable

Re: Please support coo.h

2010-06-10 Thread yuanbin
This compiler's extension is valuable 2010/6/10 Wojciech Meyer wojciech.me...@googlemail.com: On Thu, Jun 10, 2010 at 2:10 PM, yuanbin yuanb...@gmail.com wrote: initialization of global variable? No, just define a macro. 2010/6/10 Andreas Schwab sch...@redhat.com: yuanbin

Re: Please support coo.h

2010-06-10 Thread Dave Korn
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

Re: Please support coo.h

2010-06-10 Thread yuanbin
typedef struct CBase { int i; } CBase; typedef struct CT1 { EXTENDS(CBase) ... } CT1; typedef struct CT2 { EXTENDS(CT1) ... } CT2; ... typedef struct CTN { EXTENDS(CTN_1) ... } CTN; CTN t; t.i=1; //need not t.CTN_1CT2.CT1.CBase.i ---complex CBase* p=t.CBase; //need not

Re: Please support coo.h

2010-06-10 Thread Magnus Fromreide
On Fri, 2010-06-11 at 08:44 +0800, yuanbin wrote: typedef struct CBase { int i; } CBase; typedef struct CT1 { EXTENDS(CBase) ... } CT1; typedef struct CT2 { EXTENDS(CT1) ... } CT2; ... typedef struct CTN { EXTENDS(CTN_1) ... } CTN; CTN t; t.i=1; //need not t.CTN_1CT2.CT1.CBase.i

Re: Please support coo.h

2010-06-10 Thread Ian Lance Taylor
yuanbin yuanb...@gmail.com writes: typedef struct CBase { int i; } CBase; typedef struct CT1 { EXTENDS(CBase) ... } CT1; typedef struct CT2 { EXTENDS(CT1) ... } CT2; ... typedef struct CTN { EXTENDS(CTN_1) ... } CTN; CTN t; t.i=1; //need not t.CTN_1CT2.CT1.CBase.i ---complex CBase*