Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #164455

Re: Is the output of this program compiler dependent?

From James Kuyper <jameskuyper@alumni.caltech.edu>
Newsgroups comp.lang.c
Subject Re: Is the output of this program compiler dependent?
Date 2022-01-17 15:52 -0500
Organization A noiseless patient Spider
Message-ID <ss4kub$csn$2@dont-email.me> (permalink)
References <ss2nci$a2k$1@gioia.aioe.org> <ss2okf$i0l$1@gioia.aioe.org> <ss36s7$ask$1@dont-email.me>

Show all headers | View raw


On 1/17/22 2:46 AM, David Brown wrote:
...
> First, the order of evaluation of parameters to a function is

I think you mean "arguments" rather than "parameters".

> "indeterminately sequenced".  (As is the function identifier itself,
> which could be a function pointer.)


"Except as specified later, side effects and value computations of
subexpressions are unsequenced." (6.5p3). The description of Function
calls (6.5.2.2) specifies that there is a sequence point separating
evaluation of the function designator and the function arguments from
the evaluation of the function call itself, but says nothing about the
sequencing of the function designator and the arguments relative to each
other, so 6.5p3 applies to those.

This matters because evaluations that are unsequenced can be
interleaved, but evaluations that are indeterminately sequenced cannot
be be interleaved (footnote 13).

Evaluations in a calling function can be indeterminately sequenced
relative to the called function (6.5.2.2p10), and evaluations in an
initializer list are indeterminately sequenced relative to each other
(6.7.9p23). In all other cases, evaluations are either sequenced or
unsequenced relative to each other, but never indeterminately sequenced.

Back to comp.lang.c | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: Is the output of this program compiler dependent? Satan <satan@dot.com> - 2022-01-17 03:39 +0000
  Re: Is the output of this program compiler dependent? Richard Damon <Richard@Damon-Family.org> - 2022-01-16 23:19 -0500
  Re: Is the output of this program compiler dependent? James Kuyper <jameskuyper@alumni.caltech.edu> - 2022-01-16 23:24 -0500
  Re: Is the output of this program compiler dependent? David Brown <david.brown@hesbynett.no> - 2022-01-17 08:46 +0100
    Re: Is the output of this program compiler dependent? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-01-17 12:36 +0000
      Re: Is the output of this program compiler dependent? David Brown <david.brown@hesbynett.no> - 2022-01-17 15:26 +0100
        Re: Is the output of this program compiler dependent? Öö Tiib <ootiib@hot.ee> - 2022-01-17 08:04 -0800
        Re: Is the output of this program compiler dependent? James Kuyper <jameskuyper@alumni.caltech.edu> - 2022-01-17 15:51 -0500
    Re: Is the output of this program compiler dependent? James Kuyper <jameskuyper@alumni.caltech.edu> - 2022-01-17 15:52 -0500

csiph-web