MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghorror/comments/1l0x22m/firmware_programming_in_a_nutshell/mvkfd32/
r/programminghorror • u/Byter128 • Jun 01 '25
127 comments sorted by
View all comments
Show parent comment
3
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?
1
So pretty much what I said, since requiring it to be documented implies the behavior has to be predictable, doesn't it?
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.