-
Notifications
You must be signed in to change notification settings - Fork 14
/
descr
48 lines (46 loc) · 827 Bytes
/
descr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
The input/output library <stdio.h> shall not be used
Checks the program for a usage of the next functions defined in the file <stdio.h>:
- fclose
- clearerr
- feof
- ferror
- fflush
- fgetpos
- fopen
- fread
- freopen
- fseek
- fsetpos
- ftell
- fwrite
- remove
- rename
- rewind
- setbuf
- setvbuf
- tmpfile
- tmpnam
- fprintf
- printf
- sprintf
- vfprintf
- vprintf
- vsprintf
- fscanf
- scanf
- sscanf
- fgetc
- fgets
- fputc
- fputs
- getc
- getchar
- gets
- putc
- putchar
- puts
- ungetc
- perror
The algorithm is pretty straightforward: we check the input edges for every subroutine
in the program callgraph, and if there are some then the subroutine is considered as a used one,
i.e. there is at least one call of the given subroutine.