Groups | Search | Server Info | Login | Register


Groups > comp.std.c > #6580

Re: Function calls

Newsgroups comp.std.c
Date 2023-10-05 20:50 -0700
References <calls-20231004163135@ram.dialup.fu-berlin.de> <86bkdddd20.fsf@linuxsc.com>
Message-ID <dff9aa5c-bb01-48e8-8793-79af97775a5dn@googlegroups.com> (permalink)
Subject Re: Function calls
From James Kuyper <jameskuyper@alumni.caltech.edu>

Show all headers | View raw


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).

Back to comp.std.c | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: Function calls Tim Rentsch <tr.17687@z991.linuxsc.com> - 2023-10-04 19:21 -0700
  Re: Function calls James Kuyper <jameskuyper@alumni.caltech.edu> - 2023-10-05 20:50 -0700
    Re: Function calls Tim Rentsch <tr.17687@z991.linuxsc.com> - 2023-10-06 05:38 -0700
      Re: Function calls James Kuyper <jameskuyper@alumni.caltech.edu> - 2023-10-06 18:04 -0700
        Re: Function calls Tim Rentsch <tr.17687@z991.linuxsc.com> - 2023-10-08 15:30 -0700

csiph-web