|
|
|
|
|
by pmjordan
5808 days ago
|
|
The rule you're alluding to is that you mustn't modify the same value more than once between sequence points. I don't think that rule applies here, as it's modifying fp (a pointer value) and then the memory location at the address of fp's original value: the increment operator has higher precedence than dereferencing (which is of course an arbitrary rule I happen to have memorised, and many have not). The right hand side has no side effects. It's certainly confusing code, but I'm fairly sure the outcome is well-defined. That doesn't mean it's good code: I'd never write it like that. I find this far easier to understand, and that's how I'd write it in practice: *fp >>= 4;
++fp;
The postfix while condition isn't one of my favourites either, but not quite as confusing. |
|
Not sure what 'may' means though
EDIT:
So to clarify, my suspicion is that the expression could mean either:
1)
or2)