re-enable -fcatch-undefined-behavior, work around readdir() bug in mac os x
branch merge