We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to check in two groups of error diagnostics methods, to be accessed via
#include "errors.h"
Firstly, a generic error message utility:
eprintf(char*, varargs);
This prints file, line number, function, and the error message, and then exits. Similarly, a generic warning utility:
Wprintf(char*, varargs);
Secondly, a generic utility to use when no case is selected:
invalid_value_error(int); invalid_value_error(char *); invalid_value_error(double);
and
unsupported_value_error(int); unsupported_value_error(char *); unsupported_value_error(double);
The most typical use is in the default clause of a switch statement. For example, in a routine to compute based on the number of dimensions :
switch(ndims) { default: unsupported_value_error(ndims); case 2: b2=1-mbc; s2=S2+2*mbc; case 1: b1=1-mbc; s1=S1+2*mbc; case 0: ; }
The text was updated successfully, but these errors were encountered:
Issue CmPA#29: add errors.h for diagnostics: eprintf() and invalid_va…
c4eaee2
…lue_error()
No branches or pull requests
I want to check in two groups of error diagnostics methods, to be accessed via
Firstly, a generic error message utility:
This prints file, line number, function, and the error message, and then exits. Similarly, a generic warning utility:
Secondly, a generic utility to use when no case is selected:
and
The most typical use is in the default clause of a switch statement. For example, in a routine to compute based on the number of dimensions :
The text was updated successfully, but these errors were encountered: