some casts of void* to char* to legalise -pedantic arithmetic