Fix ICC warnings
[gromacs/AngularHB.git] / src / contrib / test_fatal.c
blobc7f2849314adaa097ab13e7b4c0ae087812e270f
1 #include "gromacs/utility/fatalerror.h"
3 void my_func(char *msg)
5 fprintf(stderr,"Welcome to my_func\n%s\n",msg);
6 exit(1);
9 int main(int argc,char *argv[])
11 int n = -3;
12 int choice;
13 char *end;
15 /* set_gmx_error_handler(my_func);*/
17 if (argc <= 1)
18 gmx_fatal(FARGS,"Expected an integer argument to %s",argv[0]);
19 choice = strtol(argv[1], &end, 10);
20 if (end!='\0')
21 gmx_fatal(FARGS,"Expected an integer argument to %s",argv[0]);
24 switch (choice) {
25 case 1:
26 gmx_error("pme","oooo");
27 break;
28 case 2:
29 gmx_fatal(FARGS,"Passing string %s to you %f %d %x","lll",8.3,34,34);
30 break;
31 case 3:
32 range_check(n,1,5);
33 break;
34 default:
35 range_check(choice,1,3);
37 return 0;