C vs. FORTRAN

Barnacle Wes wes at obie.UUCP
Fri Jul 8 16:17:47 AEST 1988


In article <872 at garth.UUCP>, smryan at garth.UUCP (Steven Ryan) writes:
> Actually, the real discussion is why does C have such a crippled argument
> list? It is possible to pass a list of argument descriptors. The descriptor
> list can be staticcally created and the overhead is just a register load
> of a relocated address.
>
> Why not? Because most of the C users out there are more interested in
> speed than security. Is that efficient?

You can, easily.  Like this:

typedef enum {EOL, Char, Int, Char_ptr, Int_ptr } points_to_what;

typedef struct {
	points_to_what what;
	void *pointer;
} arg_item;

You create an array of `arg_item's, with the `what' field of the last
item being `EOL'.  This is, of course, much slower, but more secure.
The answer to your question `Why not?' is actually `Because it is not
necessary in the general case.'

Nobody is holding a pistol to your head forcing you to use C here - if
you don't like, go away and don't ruin our discussions!
-- 
                     {hpda, uwmcsd1}!sp7040!obie!wes
           "Happiness lies in being priviledged to work hard for
           long hours in doing whatever you think is worth doing."
                         -- Robert A. Heinlein --



More information about the Comp.lang.c mailing list