| 1 | FOREACH operator do non-regression tests with all possible types. |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | CAREFUL with OPTIMIZATIONS: should not remove any operations that might |
|---|
| 5 | be erroneous !! |
|---|
| 6 | |
|---|
| 7 | CIL |
|---|
| 8 | --- |
|---|
| 9 | - CIL simplifies &(*ptr) into ptr. If ptr is out of bounds or NULL, |
|---|
| 10 | the erroneous pointer dereference will not be flagged. |
|---|
| 11 | - CIL forgets const attribute for this example: |
|---|
| 12 | void main () { |
|---|
| 13 | const int x = 5; |
|---|
| 14 | int* ptr; |
|---|
| 15 | |
|---|
| 16 | ptr = &x; |
|---|
| 17 | printf ("%d\n", x); |
|---|
| 18 | *ptr = 6; |
|---|
| 19 | printf ("%d\n", x); |
|---|
| 20 | return 0; |
|---|
| 21 | } |
|---|
| 22 | |
|---|
| 23 | C syntax |
|---|
| 24 | -------- |
|---|
| 25 | - look at the possibility to do with the if/then/else as in the switch |
|---|
| 26 | - volatile attribute: add flag. |
|---|
| 27 | - volatile and assumptions: add the possibility to constraint a sensor |
|---|
| 28 | volatile variable |
|---|
| 29 | - const attribute as a flag? impossible for CIL local consts. |
|---|
| 30 | Only for const strings? |
|---|
| 31 | - cast int <-> enum: more precise ? |
|---|
| 32 | - handle bitfields? |
|---|
| 33 | void main () { |
|---|
| 34 | struct { |
|---|
| 35 | unsigned field1 :4; |
|---|
| 36 | unsigned :2; |
|---|
| 37 | unsigned field2 :2; |
|---|
| 38 | }full_of_fields; |
|---|
| 39 | |
|---|
| 40 | int x; |
|---|
| 41 | |
|---|
| 42 | full_of_fields.field2 = 1; |
|---|
| 43 | full_of_fields.field1 = 0; |
|---|
| 44 | |
|---|
| 45 | x = full_of_fields.field1; |
|---|
| 46 | } |
|---|
| 47 | |
|---|
| 48 | |
|---|
| 49 | Kernel |
|---|
| 50 | ------ |
|---|
| 51 | - in newspeak.mli, put in common all (Int64.t * Int64.t) by defining a new type |
|---|
| 52 | - for merging different files two solutions: |
|---|
| 53 | Mergecil puis Cil2kernel ou Cil2kernel puis Mergekernel (compile / link) |
|---|
| 54 | - merge: beware of extern storage? |
|---|
| 55 | - Goto in Ifs -> document ml and mli and send a mail to sourceforge |
|---|
| 56 | - sizeof(void) |
|---|
| 57 | - cast from pointer to (int) and addition of integer same as addition of |
|---|
| 58 | pointers in two-complement... |
|---|
| 59 | - handle error when function main not defined (in kernelmerge ?) |
|---|
| 60 | - Problem of architecture dependent data. They are currently located in |
|---|
| 61 | Cilutils (sizeof* and offsetof). Think about another solution ? |
|---|
| 62 | - Document the fact that all pointer comparisons are cast into uint |
|---|
| 63 | comparisons by CIL (Eq and Ne are arithmetic binary ops) |
|---|
| 64 | - Write an interpreter. The simplest way would be to use the analyser |
|---|
| 65 | structure and change the abstract semantics to the concrete one |
|---|
| 66 | - Write correctly the formalism of cil2kernel |
|---|
| 67 | - Add some tests about TNamed types |
|---|
| 68 | - Could make an option to replace all BNot by equivalent arithmetic operations |
|---|
| 69 | according to the type: -(x+1) or max_int - x |
|---|
| 70 | - create documentation files and directory |
|---|
| 71 | - possible optimisation: 0 * x => 0, 0 + x => x |
|---|
| 72 | - optimisation see example number 012.c !! |
|---|
| 73 | - optimisation: what happens with multiple(5) coerce with same bounds ? |
|---|
| 74 | - maybe should add the type of function next to fid for function call ? |
|---|
| 75 | - since we have operator boolean and in Newspeak expression |
|---|
| 76 | (always evaluated), boolean conditions are not necessary anymore ? |
|---|
| 77 | - CAREFUL: match_while is problematic because it transforms expressions with |
|---|
| 78 | possible side-effects (or errors) into a side-effects free boolean formula. |
|---|
| 79 | + it is not able to handle or expressions. |
|---|
| 80 | - do some sanity checks |
|---|
| 81 | |
|---|
| 82 | Organisation |
|---|
| 83 | ------------ |
|---|
| 84 | - remove npk prefix from all .ml files. |
|---|
| 85 | - Really think where anything should go in the end : Npkutils, Npkil... |
|---|
| 86 | |
|---|
| 87 | |
|---|
| 88 | Output |
|---|
| 89 | ------ |
|---|
| 90 | - output of the address of functions is not nice (&funf). Maybe a space is |
|---|
| 91 | missing. |
|---|
| 92 | - should output global variables in the same order as they appear in the source |
|---|
| 93 | code. What about multiple files ? |
|---|
| 94 | |
|---|
| 95 | Miscellaneous examples |
|---|
| 96 | ---------------------- |
|---|
| 97 | > char t[100]; |
|---|
| 98 | > // ici: i + n <= 100 |
|---|
| 99 | > memcpy(&(t[i]), src, n) |
|---|
| 100 | > |
|---|
| 101 | > Or on traduit ca vers un &t + belongs([0; 99]) (i) |
|---|
| 102 | > Or n = 0 et i = 100 peut arriver et n'est pas un bug. |
|---|
| 103 | > |
|---|
| 104 | > Donc, je pense il faut traduire ca en &t + belongs([0; 100]) (i) |
|---|
| 105 | > (Seulement parce qu'il est acceptable d'avoir un pointeur qui pointe juste |
|---|
| 106 | > apres la dernière case) |
|---|