If an exception is raised as part of building with mach, the warnings file is not saved to disk. We should probably add a try..finally or context manager to ensure the warnings database is always saved, even if the build is aborted prematurely. To anyone interested in tackling this, the file in mozilla-central is python/mozbuild/mach/commands/build.py. You'll need to ensure that the line: warnings_database.save_to_file(warnings_path) is always called, even if the _run_make command above it throws.
This was addressed in bug 807974.