Keith Thompson said:
Since you made your claim just after the rather remarkable claim that
the standard refers to "passing by reference" (a phrase it never
uses), I'm not going to take your word for this.
You can retract that assertion, I never put the phrase in quotes.
I simply said that they mention passing by reference by virtue
of passing parameters by means of what they call references, with
the implication that I consider passing references to be passing
by reference.
Mark Wooding is correct. Arrays are not passed as arguments;
No issue with that clause (I disagree with the first sentence
obviously).
an array
expression is converted to a pointer, and the resulting pointer can
then be passed as an argument.
No issue with that clause either.
I'm curious why you felt the need to parrot such obvious things -
did you think that I was not aware of them, or something?
I'll note here that you explicitly adorned the verb "pass" with
"as arguments" in both cases above, I'll come back to that right
at the end.
If there's some other wording in the
standard that refers to passing arrays by their address, please cite
it. (If there is, it's probably just an informal statement, possibly
even an error.)
Well, not "passing arrays by their address", but certainly "passing
[something]" where you and I know, and anyone conversant with C too,
that the value actaully passed isn't what follows the word "pass",
and which I believe you ought to object to, given your prior stance.
... then passes the array as a single argument ...
... passes the string pointed to ...
I'm guessing you simply searched for 'pass', too, didn't you, and
didn't detect the 'third person' 'singular' clue above? Then again,
if you don't use 'passed' too, you'll miss in the search/sort
functions, where of course objects are passed via their address:
... objects are passed more than once to the comparison function ...
[*] ... objects passed as arguments to that call.
and other "passed"s include:
Strings ... pased as the 2nd argument to setlocale. (twice)
... the list ... is passed to function f4.
[the list being implement as an array of pointers]
And of course there's the function pointer that you've skipped
over too:
To pass one function to another ...
So that's 6 clear unambiguous uses of the the verb 'pass' where
the direct object in the text is different from what is actually
passed.
Incidentally, "actually passed" is a quote from the standard too -
they appreciate that sometimes things *described* as being "passed"
(namely the 6 I refer to above) aren't actually passed.
Note - the [*]-ed clause above I do not believe is well-worded at
all, and would explicitly (and hereby) support your call for that
one to be changed, were you to feel strongly enough about the
wording of the standard to raise it with the standards committee.
"passed as arguments" says too much and the extra implications are
incorrect.
Phil