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

Vladimír Kotal vlada at kotalovi.cz
Tue Feb 21 21:00:04 CET 2023


As for the undefined behavior, it is/was often source of jokes, such as the one found on the now nonexistent Wikipedia article (hence the archive.org link) for a hypothetical architecture: https://web.archive.org/web/20080419132129/https://en.wikipedia.org/wiki/DeathStation_9000

That said, the spec does not encourage the implementation to do something wild or on the other hand not to do anything.

Enjoy,

V. Kotal

On Mon, Feb 20, 2023, at 16:04, 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?
> 
> Thank you!
> 
> Sincerely,
> Aryan
> _______________________________________________
> c-prog-lang-l mailing list
> c-prog-lang-l at mff.cuni.cz
> http://mbox.ms.mff.cuni.cz/listserv/listinfo/c-prog-lang-l
> 
-------------- next part --------------
HTML attachment scrubbed and removed


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