Russ Whitaker wrote:
on 1/18 you wrote
...the varargs functions are intended to be replaced sooner or later
ok so how about changing some of the .c files to .cpp? Then you could use c++'s "function overloading" to replace the varargs
Nice idea (apart from the fact that I don't like C++ very much ;-), and it might make building GPC more difficult if it depends on a C++ compiler), but it would only work for one of the five varargs functions (_p_string). The others (_p_write etc.) can have an infinite number of combinations of arguments (just like Write etc. in Pascal), which can't be done by overloading.
But, as I said, it's not *too* bad since we're planning to simply break up the functions, i.e. instead of:
_p_write (f, CODE_FOR_INTEGER, integer_value, CODE_FOR_REAL, real_value, CODE_FOR_WRITELN);
the compiler will issue calls to:
_p_write_integer (f, integer_value); _p_write_real (f, real_value); _p_writeln (f);
This should also be a little bit more efficient at runtime, since the RTS doesn't have to do dispatching...
Frank