GCC headers and DJGPP port (OT)
Linus Torvalds
torvalds@transmeta.com
Sun Jul 23 12:13:00 GMT 2000
On Sun, 23 Jul 2000, Phil Edwards wrote:
>
> > That was one of my pet peeves about C++: I always considered the
> > historical "#define NULL 0" to be complete braindamage due to lack of
> > even the simplest kind of type-checking (and matching to a pointer type
> > is just one small portion of that type-checking - getting sane and
> > appropriate warnings is quite important).
>
> Funny, that's always been one of my pet peeves about C. :-)
Hmm.. In C you _can_ avoid type-checking, but it's not that hard to make
it reasonably strongly typed: using gcc the magic flags are "-Wall
-Wstrict-prototypes", and some simple rules.
You still get all the implicit integer and FP conversions done, and that
can be occasionally painful, but not doing them is even more painful, so..
I don't think "void *" is a problem. It just should be used with extreme
caution. I think the "enum is a normal integer" thing is a much bigger
issue type-checking-wise.
Linus
More information about the Gcc
mailing list