improve printf/warning/error on Mac OSX