Assignment and sequence points: how is this ambiguous?

后端 未结 6 1058
礼貌的吻别
礼貌的吻别 2021-01-21 08:46

Consider the C code a = a = a. There\'s no sequence point for assignment, so this code produces a warning when compiling about an undefined operation on a

6条回答
  •  青春惊慌失措
    2021-01-21 09:39

    This is actually undefined behavior. a can have any value at all. "I can't think of any way it can break" is not the same as "it's guaranteed to work".

提交回复
热议问题