Add a merge hook. Handle the situations like:
[smatch.git] / smatch.c
blob665f14b716a974a22dadd7af1b58df7115907920
1 /*
2 * sparse/smatch.c
4 * Copyright (C) 2006 Dan Carpenter.
6 * Licensed under the Open Software License version 1.1
8 */
10 #include <stdio.h>
11 #include "smatch.h"
13 typedef void (*reg_func) (int id);
14 void register_derefed_params(int id);
15 void register_null_deref(int id);
16 void register_smatch_extra(int id);
17 void register_smatch_ignore(int id);
18 void register_overflow(int id);
20 const reg_func reg_funcs[] = {
21 &register_smatch_extra,
22 &register_smatch_ignore,
23 &register_null_deref,
24 &register_overflow,
25 NULL
28 int main(int argc, char **argv)
30 int i;
31 reg_func func;
33 /* The script IDs start at 1.
34 0 is used for internal stuff. */
35 for(i = 0; (func = reg_funcs[i]); i++){
36 func(i + 1);
39 if (argc >= 2 && !strcmp(argv[1], "--debug")) {
40 debug_states = 1;
41 argc--;
42 argv++;
45 smatch(argc, argv);
46 return 0;