add function to check valid path component
workaround for undefined behavior bug in darwin
change name of log() function to logging_log() to avoid name clashes with standard math library