The easy answer to that question is, "use a different language",
*cough* C++ STL *cough*, that has better type safety built into the
language. These questions have been around for a very long time,
and C has tended to remain the way that it is with respect to type
safety. I think your criticisms are valid, and agree with them,
and if it was the only deciding factor, no one would choose C to
do anything of this sort. In fact, C was around when Stepanov was
working on his stuff, and he didn't use C. Hmmm, is that a
Do you believe that this is a worthy pursuit in C at all?
Depends on what you mean exactly. Is it worth to invent a new
language feature for C to "fix" this? No, I don't think so. I also
think that "generic containers" (whatever they look like) don't belong
into future C standards as part of the library. But that's just my
opinion. Still, I _am_ interested in what people can come up with in
C and what die-hard C programmers consider to be "elegant" designs of
"generic linked lists".
alone if you don't think it is. However, there are some people who do
think it is.