Sujet : Re: 80386 C compiler
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.lang.cDate : 27. Nov 2024, 11:00:42
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vi6qka$3umr4$1@dont-email.me>
References : 1 2 3 4 5 6
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
On 26/11/2024 18:59, Kaz Kylheku wrote:
On 2024-11-25, Rosario19 <Ros@invalid.invalid> wrote:
On Mon, 25 Nov 2024 18:23:58 -0000 (UTC), Kaz Kylheku wrote:
>
void fn(int a)
{
int x[3] = { foo(), bar(), a }; /* not in C90 */
>
is in the above foo() called before bar()?
No, you cannot rely on that. Maybe it's fixed in a more recent standard,
The implication of the word "fixed" is that you think the current standards as somehow "broken" in this respect. Do you think that is the case?
The C standards go to quite an effort to say when you have a guarantee about the order of execution, and when the compiler has the freedom to re-arrange things for greater efficiency (and perhaps to discourage people from writing unclear code).