Right. I've been tied up with work and have not had time to return to
this squabble, which is OT for c.l.c and fairly pointless anyway. I'll
respond to some specific points in this message if I feel I need to do
so, but on the whole I'd like to propose the following:
1. Most C implementations do not check pointer validity.
2. Some, however, do; the three I named for the AS/400 are examples.
3. I feel that (2) is a significant exception to (1).
4. You do not.
5. The origin and preferred usage of the phrase "the exception that
proves the rule" is disputed.
6. However, some people - including myself and some other c.l.c
readers - feel that when that phrase is used to mean "an
exception to a general rule demonstrates the validity of that
rule in other cases", it's somewhat lacking in rhetorical power.
Other people, of course, may feel differently.
Fair enough?
Ho ho. So you understand how language works do you?
Well enough. I'm ABD in critical theory (and twentieth century
Anglophone prose). I've studied structural linguistics, socio-
linguistics, pragmatics, speech act theory, and poststructuralist
linguistics (as well as various fields that are arguably cognate).
I've read a good bit of philology. My fiance is a professor of
rhetoric in one of the top rhetoric departments in the US, so I spend
quite a lot of time discussing language with other folks familiar
with the subject. I don't need J. Random Poster to tell me that
etymology doesn't determine current use.
See the other threads on bounds checking. There is no point using C if it
does not compile to efficient code, just as there is no point having a
sports car if you are driving it down a traffic-calmed street.
I disagree that the only justification for using C is efficiency of
the resulting code. In my work, for example, I generally have to
produce code which can be ported to various other platforms by other
developers; I am limited in the demands I can put on them, and they
currently deal with C and COBOL. Given that choice, I'll take C.
And since portability is a huge concern in my work - a portation
problem in one component can stall the build "pipeline" for everyone
- the C matters that c.l.c deals with are the ones that I care about
the most.
An example: Chris Torek corrected my use of vsnprintf some months
back, which let me fix a nasty memory-corruption bug in Linux/390.
My error was not "restarting" va-processing with va_end and va_start
between calls to vsnprintf. That's a harmless error in many
implementations, but in some implementations va_arg is destructive
and trying to iterate through the argument list again invokes nasal
demons. That's why the standard forbids it - a point I missed in
my original code.
Because registers are probably 32 bits, and there are probably not too many
of them, so you will thrash memory.
You miss my point. Making *any* guess about how the AS/400 C
implementations work under the covers is taking a stab in the dark,
and likely to mislead you. It doesn't matter how large CPU registers
are in AS/400 C, because (at least in "classic" EPM C) function calls
didn't use them anyway. They weren't accessible to the implementation.
So C's use of 128-bit pointers (ie "native" MI pointers) didn't have
any noticeable adverse effect on performance for any normal program.
--
Michael Wojcik (e-mail address removed)
An intense imaginative activity accompanied by a psychological and moral
passivity is bound eventually to result in a curbing of the growth to
maturity and in consequent artistic repetitiveness and stultification.
-- D. S. Savage