warnings should be printed to stderr, fix #2171