Uses the warning API properly rather than directly to stderr