fix glibc and unused incr warning