[C-prog-lang-l] sequence points inquiry

Jan Pechanec jp at devnull.cz
Mon Feb 20 17:09:04 CET 2023


On Mon, 20 Feb 2023, Aryan Kumar wrote:

>Dear Professor,
>
>I asked you about side effects in the lecture today, when you mentioned
>that sequence points are points in the program, where no more side effects
>shall take place. I did some research and came to the conclusion that side
>effects are any observable changes in the state of a program -- for
>instance, memory writes, IO activity, function calls, exceptions, etc.
>Furthermore, we can make some guarantees about the program state at a
>sequence point.
>
>Please let me know if this understanding is flawed.
>Besides that, I have another question about undefined and unspecified
>behavior.
>Is it true that undefined behavior results from program execution that is
>not defined in the C specification -- like indexing outside bounds --
>whereas unspecified behavior is when the program execution depends on the
>compiler -- like adding integer function calls?

Please see types-of-behavior.md and undefined-behavior.md modules in 
our github repository.

Regarding the side effect, please see 5.1.2.3 Program execution of the 
C99 spec.  The link is on our web page at the end.

Jan

-- 
Jan Pechanec <jp (at) devnull (dot) cz>
http://www.devnull.cz


More information about the c-prog-lang-l mailing list