dot-collectWarnings function

Collect warnings and just warn once.