Stop using gmx_fatal in grompp
commit699bd4995eb1276173358d7f4941ed53dedc0e4f
authorMark Abraham <mark.j.abraham@gmail.com>
Tue, 23 Aug 2016 22:40:04 +0000 (24 00:40 +0200)
committerDavid van der Spoel <davidvanderspoel@gmail.com>
Sat, 27 Aug 2016 17:58:59 +0000 (27 19:58 +0200)
tree5ffebbeaf71e11db7af5f52cd978b57906ce9e19
parentc4d341008831608df8736b1a79b27edba7ffcb5a
Stop using gmx_fatal in grompp

Added warning_error_and_exit to issue an error that describes the
location in the input file, and then halt processing (because data
structures would not be safe to use) while also describing where in
the code that occured. Either set of metadata can be useful to users
or developers diagnosing issues.

Refactored implementation of check_warning_error() so that
warning_error_and_exit() can have the gmx_noreturn qualifier, so that
analyzers understand the behaviour of the calling code, and compilers
can understand the implementation of warning_error_and_exit().

This permits more effective diagnostics in various places, and
eliminates some existing hacks.

Bumped all declarations of errbuf to have size STRLEN, since some of
the new uses might be safer that way.

Also made a minor fix to output to avoid redundant output from
done_warning when an error has occured.

Change-Id: I29f8afeb70d0da3598c6443c15090bca9bf5c639
src/gromacs/fileio/warninp.cpp
src/gromacs/fileio/warninp.h
src/gromacs/gmxpreprocess/topio.cpp
src/gromacs/gmxpreprocess/toppush.cpp
src/gromacs/gmxpreprocess/toppush.h