Topic: Sequence point at function entry
Author: v.Abazarov@attAbi.com ("Victor Bazarov")
Date: Thu, 27 Mar 2003 01:25:45 +0000 (UTC) Raw View
"Stefan Ram" <ram@zedat.fu-berlin.de> wrote...
> 1.9, p17 asserts a sequence point "after the evaluation of
> all function arguments" which "takes place before execution
> of any expressions or statements in the function body".
>
> After the evaluation of all function arguments and before
> the execution of any expressions or statements in the
> function body is the parameter initialization, that may
> involve side effects and sequence points if type conversions
> are required and defined type conversion functions are
> invoked for that purpose.
>
> So is this reading correct, that 14882 does not specify
> when exactly that sequence point happens, i.e., before
> or after parameter initialization? Is this Looseness there
> for a specific reason? If 14882 would be more specific and
> require that sequence point exactly at entry of the function
> body the order of argument evaluation and parameter
> initialization would still be unspecified as it is now.
> Or have I overlooked any assertation of 14882 about this?
I think the "evaluation of function arguments" is precisely
what you call "parameter initialisation". The standard makes
no distinction between parameters and arguments when it comes
to execution time. Arguments are what the function sees when
execution reaches the opening curly brace of the function body.
The sequence point is after conversions and creation of needed
temporaries and before the first executable statement of the
function. That's how I read it.
Victor
--
Please remove capital A's from my address when replying by mail
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]