Joseph Dionne said:
It astounds me to read some the post here, most being "off topic" or
"don't do that" for people seeking solutions to problems the
responders have most likely implemented.
This newsgroup discusses the C programming language as defined by the
ISO standard(s) (C99 and C90); older references such as K&R1 are also
topical for historical discussions. If you want to discuss something
that's specific to some system, you can do so in a newsgroup that
discusses that system.
I understand that the name "comp.lang.c" might lead you to think that
we discuss anything and everything having to do with C programming.
We don't. Now you know.
It also astounds me to realize how many c programmers, a low level
language, have little to no understanding of how the c compiler works,
some even claiming the OS "jumps to main" which is completely false.
It is apparent many posters have little understanding of the structure
of an executable object created by the compiler, or how executable
object loaders function.
There is no such thing as "the C compiler". There are a plethora of C
compilers, and they don't all work the same way. The only thing they
all have in common is that they all (to the extent that they're
correct) implement the C programming language. The core of that
language is defined by the ISO standard(s). (I'm being vague about
C90 vs. C99 because C99 is the current "official" standard, but C90 is
still more widely implemented.)
[snip]
With all due respect people, we are coding to hardware architectures
-- CPUs, PIAs, memory address controllers, etc -- and using c for it
tight code generation for speed. I doubt any new c programmers even
attempt to learn assembler for the processor they work on most, or use
their c compiler to emit the assembler code and see the correlations
between the c code to what is being generated.
Most of us are coding programs that are intended to perform some
particular task. Very often we can do so in standard C, without
concern for what the underlying hardware look like; if so, the code is
likely to be portable to different systems, which is an extremely
useful attribute. Occasionally, we might need to delve into
system-specific features; such things are best discussed in
system-specific newsgroups.
And I couldn't help noticing that you never actually answered my
question. I'll ask it again: Does K&R really say that arguments are
passed by placing their values on "the stack"? I've just checked my
copies of K&R1 and K&R2, and the answer appears to be no (I see no
mention of a "stack" in the section on functions and argument passing,
and there's no "stack" entry in either book's index). But, as they
say, you can't grep dead trees, and I could have missed something.
In the short time you've been here, you've posted a number of things
that are simply incorrect. (The most blatant was your statement about
unary vs. binary "&".) We all make mistakes now and then, but
refusing to acknowledge them is an efficient way to destroy your own
credibility.