cvs commit: src/sys/kern sched_ule.c

Christoph Mallon christoph.mallon at gmx.de
Sat Mar 17 20:31:23 UTC 2007


Max Laier schrieb:
> On Saturday 17 March 2007 20:09, Jeff Roberson wrote:
>> Any language lawyers care to comment on this?
> 
> I find this strange.  According to the spec "(Decrementing is equivalent 
> to subtracting 1.)", but "pri = --pri % RQ_NQS;" will behave like you 
> expect, while "pri = (pri - 1) % RQ_NQS;" clearly didn't.

"pri = --pri % RQ_NQS;" modifies "pri" twice between two sequence 
points. According to the C standard this causes undefined behaviour!


More information about the cvs-src mailing list