Do slightly better on casts.
[smatch.git] / obfuscate.c
blob12fb9c3954a9b71ee1b5ccab8e69576a790916af
1 /*
2 * Example trivial client program that uses the sparse library
3 * to tokenize, pre-process and parse a C file, and prints out
4 * the results.
6 * Copyright (C) 2003 Transmeta Corp.
7 * 2003-2004 Linus Torvalds
9 * Licensed under the Open Software License version 1.1
11 #include <stdarg.h>
12 #include <stdlib.h>
13 #include <stdio.h>
14 #include <string.h>
15 #include <ctype.h>
16 #include <unistd.h>
17 #include <fcntl.h>
19 #include "lib.h"
20 #include "allocate.h"
21 #include "token.h"
22 #include "parse.h"
23 #include "symbol.h"
24 #include "expression.h"
25 #include "linearize.h"
27 static void emit_entrypoint(struct entrypoint *ep)
32 static void emit_symbol(struct symbol *sym)
34 struct entrypoint *ep;
35 ep = linearize_symbol(sym);
36 if (ep)
37 emit_entrypoint(ep);
40 static void emit_symbol_list(struct symbol_list *list)
42 struct symbol *sym;
44 FOR_EACH_PTR(list, sym) {
45 expand_symbol(sym);
46 emit_symbol(sym);
47 } END_FOR_EACH_PTR(sym);
50 int main(int argc, char **argv)
52 emit_symbol_list(sparse(argc, argv));
53 return 0;