aboutsummaryrefslogtreecommitdiff
path: root/docs/notes/errors_warnings.txt
blob: 26ea89dcc7a39833a34cd63dbfc6855d54b69e6d (plain)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70


compiler warnings/errors
------------------------

unused parameter
----------------

    requirements
    
        a) the parameter is never read (if it's a pointer it's never
           dereferenced)

        b) a reference to the parameter is never placed in a pointer
        
        c) a reference to the function is never is never placed in a pointer

member or parameter in type is never read from (or written [distinct values] to)
--------------------------------------------------------------------------------

    requirements
    
        a) the member or parameter is not exported
        
        b) the member is never read from (written distinct values to),
           or the parameter is never read from
           (or is known to not be assigned distinct values).

        c) the member is not a static constant value.

non-constant value is never changed
-----------------------------------

    requirements
    
        a) the variable or member is not constant
        
        b) it's never changed after it's initializations

constant value is not initialized
---------------------------------

    requirements
    
        a) the variable or member is constant
        
        b) it's not initialized when it's declared

value could be undefined when it might be read
----------------------------------------------

    requirements
    
        a) there might* exist a code-path such that a value at some point:
        
            a.1) is undefined**
            
            b.2) is read from

*  not always possible to check, because program verification isn't always
   possible (might require running the program, or might require external
   input). In these cases the compiler should at least print a warning (or
   an error).

** data is undefined if any of the following is true:

    a) it has not been initialized
    
    b) the underlying memory has been free'd