. There's also a section "Function calls" in a recent draft.
I expect that this section says something similar, to the effect that
during the evaluation of a function call, control is transferred to
the called function, but I was not able to find such wording!
A recent draft of the C specification says about "return":
|A return statement terminates execution of the current
|function and returns control to its caller.
. There's also a section "Function calls" in a recent draft.
I expect that this section says something similar, to the effect that
during the evaluation of a function call, control is transferred to
the called function, but I was not able to find such wording!
ram@zedat.fu-berlin.de (Stefan Ram) writes:
. There's also a section "Function calls" in a recent draft.
I expect that this section says something similar, to the effect that >>during the evaluation of a function call, control is transferred to
the called function, but I was not able to find such wording!
Now, some might say that C references "ISO/IEC 2382:2015,
Information technology — Vocabulary" which defines "call".
But this (at least in the second edition) defines a "call"
to be an /instruction/, not a runtime event.
A recent draft of the C specification says about "return":
|A return statement terminates execution of the current
|function and returns control to its caller.
. There's also a section "Function calls" in a recent draft.
I expect that this section says something similar, to the effect that
during the evaluation of a function call, control is transferred to
the called function, but I was not able to find such wording!
r...@zedat.fu-berlin.de (Stefan Ram) writes:Section 6.9.1 is about function definitions,. while 6.5.2.2 is about
A recent draft of the C specification says about "return":
|A return statement terminates execution of the current
|function and returns control to its caller.
. There's also a section "Function calls" in a recent draft.AFAICT the C standard does not say explicitly that a function
I expect that this section says something similar, to the effect that during the evaluation of a function call, control is transferred to
the called function, but I was not able to find such wording!
call gives or transfers control to the function being called.
during the evaluation of a function call, control is transferred to
the called function, but I was not able to find such wording!
On Wednesday, October 4, 2023 at 10:21:30?PM UTC-4, Tim Rentsch wrote:
r...@zedat.fu-berlin.de (Stefan Ram) writes:
A recent draft of the C specification says about "return":
|A return statement terminates execution of the current
|function and returns control to its caller.
. There's also a section "Function calls" in a recent draft.
I expect that this section says something similar, to the effect that
during the evaluation of a function call, control is transferred to
the called function, but I was not able to find such wording!
AFAICT the C standard does not say explicitly that a function
call gives or transfers control to the function being called.
Section 6.9.1 is about function definitions,. while 6.5.2.2 is
about function calls, but 6.9.1 has several paragraphs of
specification about what happens when the function is called, and
the relevant one is:
"After all parameters have been assigned, the compound statement
that constitutes the body of the function definition is executed." (6.9.1p11).
James Kuyper <james...@alumni.caltech.edu> writes:...
On Wednesday, October 4, 2023 at 10:21:30?PM UTC-4, Tim Rentsch wrote:
Yes, I mentioned that - "several paragraphs of specification aboutAFAICT the C standard does not say explicitly that a function
call gives or transfers control to the function being called.
Section 6.9.1 is about function definitions,. while 6.5.2.2 is
about function calls, but 6.9.1 has several paragraphs of
specification about what happens when the function is called, and
the relevant one is:
"After all parameters have been assigned, the compound statementThat is one relevant paragraph, but not the only relevant paragraph. Paragraph 10 of that section says
that constitutes the body of the function definition is executed." (6.9.1p11).
On entry to the function, the size expressions of each variably
modified parameter are evaluated and the value of each argument
expression is converted to the type of the corresponding
parameter as if by assignment. (Array expressions and function
designators as arguments were converted to pointers before the
call.)
What we are looking for is something that says the function isI find it confusing that you think something more needs to be
"entered", that is, that control is transferred.
On Friday, October 6, 2023 at 8:38:10?AM UTC-4, Tim Rentsch wrote:
James Kuyper <james...@alumni.caltech.edu> writes:
On Wednesday, October 4, 2023 at 10:21:30?PM UTC-4, Tim Rentsch wrote:
...
AFAICT the C standard does not say explicitly that a function
call gives or transfers control to the function being called.
Section 6.9.1 is about function definitions,. while 6.5.2.2 is
about function calls, but 6.9.1 has several paragraphs of
specification about what happens when the function is called, and
the relevant one is:
"After all parameters have been assigned, the compound statement
that constitutes the body of the function definition is executed."
(6.9.1p11).
That is one relevant paragraph, but not the only relevant paragraph.
Paragraph 10 of that section says
On entry to the function, the size expressions of each variably
modified parameter are evaluated and the value of each argument
expression is converted to the type of the corresponding
parameter as if by assignment. (Array expressions and function
designators as arguments were converted to pointers before the
call.)
Yes, I mentioned that - "several paragraphs of specification about
what happens when the function is called".
What we are looking for is something that says the function is
"entered", that is, that control is transferred.
I find it confusing that you think something more needs to be
specified.
The standard specifies that the compound statement that
constitutes the body of the function gets executed.
Could you explain how that differs from having control transferred
to the function? Please give an example of what it would mean to
have the compound statement executed without transferring control.
To me, execution of the compound statement is what I want to have
happen.
It may be a failure of my imagination, but I can't imagine what it
would mean for that to happen without transferring control, but if
it could, I also can't imagine caring.
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 1,064 |
Nodes: | 10 (0 / 10) |
Uptime: | 148:01:10 |
Calls: | 13,691 |
Calls today: | 1 |
Files: | 186,936 |
D/L today: |
33 files (6,120K bytes) |
Messages: | 2,410,931 |