Fixed some additional linux warnings

- Fixed some warnings we had missed.
- Improved -W cflag detection routines.
- Only use -Wshadow if it's actually useful.

Signed-off-by: Haru <haru@dotalux.com>