Ananth commit

Hi,

Can you please review.

o Fix build issues in mac/mavericks
o Add check for buggy gcc version when built with optimization turned on