Clean up warnings

Fix, clean up, or work around various compiler warnings in the build.

This doesn't quite get them all. A couple of projects have -deprecation turned off test sources for now.

Also tries out a workaround for internal deprecation warnings.