I think we can also get rid of the #include <stdio.h>
FWIW, I don't think there was any good reason for using printf here. Also FWIW, that part of the tests doesn't normally run (it tries to open a couple of files but nothing in the tests puts them there): it's kind of a hack for dumping generic .x files. I'd also be okay with just getting rid of the whole thing.