Fixed clang compiler warnings and switched to gnu11 dialect