I just started looking at the Ruby source (and have seen some examples of
extension code) and noticed that it seems to be written (like lots of GNU
code is/was) assuming that it might be compiled with a C compiler that
doesn't understand prototypes.
Are there really C compilers still in wide use that don't yet support
prototypes yet?
Anyway, what I'm curious about is why, even if you're using a C compiler
that uses prototypes, you aren't using them in the definition of functions.
As I recall, many of the GNU sources used a macro that would expand to a
prototyped definition when using a C compiler that supported prototypes.
I note that the declarations already use such a macro:
void rb_secure _((int));
What I'm curious about is why the corresponding definition can't also use
prototypes. It's written right now as:
void
rb_secure(level)
int level;
{ ... }
I'd think that you would want it to look like
void
rb_secure(int level)
{ ... }
instead if using a C compiler that supported prototypes. This could be done
with a macro (well, actually, a family of macros like ARG1, ARG2, etc. but
you get my drift).
The problem that I'm concerned about is argument type promotion that would
cause distinctions like between float and double, or between short and int.
Also, why is "class" spelled like "klass"? Seems like the C compilers that
you're targeting to (some of them pre-ANSI) wouldn't have any problem with
the word "class". The source is obviously not legal C++, so you wouldn't
have been feeding it to a C++ compiler...