fix test when run under -w
use external var to trap warnings rather than fatalizing
run 5.18 tests with -w enabled