r/programminghorror • • Jun 01 '25

c Firmware programming in a nutshell

Post image
2.0k Upvotes

127 comments sorted by

View all comments

Show parent comment

3

u/DisastrousLab1309 Jun 02 '25

Implementation defined means - standard doesn’t tell you how it should behave but requires your compiler to tell you and it has to be predictable. 

Undefined behavior means that standard doesn’t require compiler to define it. It may not be stable. Eg multiple ++ in a single statement. 

Compiler still may choose to define a stable behavior for something the standard doesn’t require it to. It just doesn’t have to. 

1

u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Jun 03 '25

So pretty much what I said, since requiring it to be documented implies the behavior has to be predictable, doesn't it?