Paulo Pinto <paulo.pinto@xxxxxxx> writes: > several years ago I developed a compiler that > generated bytecodes for a stack machine. > > The code was then processed with NASM > using some macros and the runtime library > was developed in C. > > I remember that at the time if I used gcc 2.7.2 > I didn't had any problems. But if I used egcs > the code would run just fine and end with a > seg fault after returning from main(). > > I never cared much about it at the time because > egcs had just appeared in the scene and > the generated code run just fine with gcc 2.7.2. > > Now a friend asked me for this compiler and > I've discover that with the latest versions of > egcs I still have the same problem as before. > > So I've decided to install gcc 2.7.2 to see if > it would generate correct code for my compiler. > > But gcc does not compile this old version. > > I get the following error message: > > cc -c -DIN_GCC -g -I. -I. -I./config bc-emit.c > In file included from bc-emit.c:948: > bc-typecd.def: In function `bc_emit_instruction': > bc-typecd.def:17: `SFtype' is promoted to `double' when passed through `...' > bc-typecd.def:17: (so you should pass `double' not `SFtype' to `va_arg') > make: *** [bc-emit.o] Error 1 > > Does anyone have any idea? Well, the error message is telling you that the code in gcc 2.7.2 is incorrect. The code used SFtype in va_arg, but it should have used double. This is not a big deal as bc-emit.c is never used. You can probably just delete that function entirely. You may run into other problems. But if I were you I would fix your code, not gcc 2.7.2. If your code crashes with the original egcs and with the current gcc 3.3.3, it is very likely that there is a bug in your code. A segfault after returning from main generally indicates stack corruption. Ian