Connecting Tech Pros Worldwide Help | Site Map

sequence points

Jrdman
Guest
 
Posts: n/a
#1: Aug 17 '08
hi

According to the standard these are how we define sequence points:


*the call to a function ,after the arguments have been evaluated

*the end of the first operand of the following operators :

{logical AND :&&

Logical OR :||

Conditional ?

Comma ,


}
*the end of a full declarator


*the end of a full expression:an initializer , the expresion in an
expression statement

the controlling expression of a selection statement (if or switch)

the controlling expresion of while or do statement,eatch of the
expressions of a for statement

the expression in a return statement


*Immediatly before a library function returns


*After the actions associated with eatch formatted input/output
function conversion specifier


*Immediatly before and immediatly after eatch call to a comparison
function,and between any call to a comparison function and any
movement of the objects passed as arguments to that call

can someone explain eatch one deeply?
Ben Bacarisse
Guest
 
Posts: n/a
#2: Aug 17 '08

re: sequence points


Jrdman <ahmed.bou23@gmail.comwrites:
Quote:
According to the standard these are how we define sequence points:
<snip full list of places where sequence point occur in C programs>
Quote:
can someone explain eatch one deeply?
That's asking for too much work. None of them seem particularly
confusing to me, so it would help if you said which ones are confusing
you. If it really is all of them, then you need to go back and review
some basic C terminology.

--
Ben.
Jrdman
Guest
 
Posts: n/a
#3: Aug 17 '08

re: sequence points


On Aug 17, 2:52*pm, Ben Bacarisse <ben.use...@bsb.me.ukwrote:
Quote:
Jrdman <ahmed.bo...@gmail.comwrites:
Quote:
According to the standard these are how we define *sequence points:
>
<snip full list of places where sequence point occur in C programs>
>
Quote:
can someone explain eatch one deeply?
>
That's asking for too much work. *None of them seem particularly
confusing to me, so it would help if you said which ones are confusing
you. *If it really is all of them, then you need to go back and review
some basic C terminology.
>
--
Ben.
Just explain what you can explain (if you want a few ones of them)

Eric Sosman
Guest
 
Posts: n/a
#4: Aug 17 '08

re: sequence points


Jrdman wrote:
Quote:
hi
>
According to the standard these are how we define sequence points:
>
>
*the call to a function ,after the arguments have been evaluated
>
[... et cetera ...]
>
can someone explain eatch one deeply?
What kind of explanation do you seek? The Standard says
that a sequence point exists at each of these moments in the
execution of a program. It's not a consequence of something
else, with an explanation like "The function arguments are
blue but the function body is yellow; the boundary between
the colors causes a sequence point." What the Standard says
is that there *is* a sequence point between the evaluation
of the arguments and the call to the function, in much the
same way someone might tell you there *is* a maple tree in
front of his house. The maple tree itself defies explanation
(cf. "Trees" by Joyce Kilmer).

--
Eric Sosman
esosman@ieee-dot-org.invalid
osmium
Guest
 
Posts: n/a
#5: Aug 17 '08

re: sequence points


"Jrdman" wrote:
Quote:
According to the standard these are how we define sequence points:
Quote:
*the end of the first operand of the following operators :
>
{logical AND :&&
>
Logical OR :||
The article in the link should be helpful in this particular case, this is a
situation where other languages may differ.

http://en.wikipedia.org/wiki/Short-circuit_evaluation

I'll leave the other to people with more time on their hands.


Anand Hariharan
Guest
 
Posts: n/a
#6: Aug 17 '08

re: sequence points


On Sun, 17 Aug 2008 07:47:06 -0700, Jrdman <ahmed.bou23@gmail.comwrote:
Quote:
hi
>
According to the standard these are how we define sequence points:
>
<snip>
Quote:
>
can someone explain eatch one deeply?
I know you were directed to reading the standard in the other thread, but
I now get the impression that you are probably better off reading the C
FAQ. It explains what sequence points are, how it could affect the code
you write, and gives you several examples.

http://c-faq.com/expr/seqpoints.html


- Anand

Malcolm McLean
Guest
 
Posts: n/a
#7: Aug 17 '08

re: sequence points



"Jrdman" <ahmed.bou23@gmail.comwrote in message news:
Quote:
According to the standard these are how we define sequence points:
>
can someone explain eatch one deeply?
|>
Imagine you are an accountant. A certain points, maybe once a week, the tax
people call in and demand to see the books. Management wants a report every
month. The shareholders get an annual report. Just occasionally one of the
subordinantes realises he's made a mistake and you have to go through seeing
if any money has been lost.
However between these points the books are being actively edited. You might
have only half the weeks' sales in the ledger because you are writing them
in. You can't respond to a demand to present the accounts just like that,
you have to have formal times at which the accounts are reconciled and
balanced.

Sequence points are like that. Every time the program needs to present an
account of the variables it holds is a sequence point. At other times, the
variables are under edit.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Ian Collins
Guest
 
Posts: n/a
#8: Aug 17 '08

re: sequence points


Jrdman wrote:
Quote:
On Aug 17, 2:52 pm, Ben Bacarisse <ben.use...@bsb.me.ukwrote:
Quote:
>Jrdman <ahmed.bo...@gmail.comwrites:
Quote:
>>According to the standard these are how we define sequence points:
><snip full list of places where sequence point occur in C programs>
>>
Quote:
>>can someone explain eatch one deeply?
>That's asking for too much work. None of them seem particularly
>confusing to me, so it would help if you said which ones are confusing
>you. If it really is all of them, then you need to go back and review
>some basic C terminology.
>>
>
Just explain what you can explain (if you want a few ones of them)
>
Go back to the referenced sections, the explanations are clear.

--
Ian Collins.
Closed Thread