Are unspecified and undefined behavior required to be consistent between compiles of the same program with the same compiler in the same environment?

前端 未结 9 1099
感情败类
感情败类 2021-01-27 05:57

Let\'s pretend my program contains a specific construct the C++ Standard states to be unspecified behavior. This basically means the implementation has to do something reasonabl

9条回答
  •  不思量自难忘°
    2021-01-27 06:34

    I don't know about unspecified behaviour (but judging from the name, maybe it does the same bad/evil thing everywhere just no one really knows what exactly it does). But for the undefined behavior, i think this one could behave VERY differently across platforms or compilers. I've seen some really strange coredumps on Solaris which did not occur on Ubuntu etc.

提交回复
热议问题