compilerflag now set to c99 standard, added patches for portability and related compiler warnings