add semaphores and configure gcc with -Wall and -Werror