add extra warning output and change debugging optimization from O0 to O2