why “f = f++” is unsafe in c?-Collection of common programming errors
The problem is Sequence Points. There are two operations in this statment with no sequence point, so there is no defined order to the statement, is the assignment happening first or the increment?
Nothing says it’s unsafe, it’s just undefined, which means that different implementations may have different results or it may format your hard drive…
Originally posted 2013-11-09 20:02:32.