You're right - it's to trigger a compiler error if you mistype "==" as "=", since an assignment will always return true. While this will usually be easy to notice and debug, once in a while it will turn into a very hard to detect bug, think of this:
#define OK 2 // Or something...
[...]
while(status = OK){
// This loop will never end
// Even if you change the value of status within it
[...]
}
That can be a nasty bug to find, especially if the block belonging to the offending statement is long (imagine looking for all the possible reasons why status is always staying OK).
If on the other hand you used:
while(OK = status){
That would throw a compiler error, since you cannot assign a value to a constant.
This practice is sometimes referred to as Yoda conditions, since it juxtaposes the object and subject. Like "if status is OK" vs "if OK is status" and "the sky is blue" vs "blue is the sky" - the latter being something Yoda might say.