Get rid of -Wpedantic warnings

- Flip on -Wpedantic
- suppress some warnings using #pragma
- fix some warnings by inserting a nil into _VA_ARG function call
- fix some warnings by replacing MIN/MAX with a ternary operator