Check for compiler warning flags before using them, this avoids
build failures across compiler versions.