return warnings array rather than print them