poll()'s counting seems to increment the pointer instead of the value
Closed this issue · 2 comments
tankorsmash commented
Line 39 in 069d450
Simplified demo of what I think is happening: http://cpp.sh/9tyco
*readerCount++
seems like it should be (*readerCount)++
to increment the value, not the pointer. Same for writerCount
.
I used VS2013, but the cpp.sh snippet uses GCC 4.9.2.
lucasrangit commented
I agree with @tankorsmash . Same is true for *writerCount++
.
Postfix ++
has higher precedence than dereference *
so it's being evaluated as *(readerCount++)
and readerCount
is a pointer on the stack.
robinrowe commented
Fixed. Thanks for the bug report.