This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
acc [2017/07/09 14:00] – korshun | acc [2017/07/09 14:15] – korshun | ||
---|---|---|---|
Line 5: | Line 5: | ||
===== Known bugs ===== | ===== Known bugs ===== | ||
+ | |||
+ | ==== 256 function limit ==== | ||
+ | |||
+ | ACSUtils has a lot more than 256 functions, but official releases of ACC can't compile programs with more than 256 functions. | ||
+ | |||
+ | To fix this, download the April 26, 2017 development version of ACC (unofficial build for Windows): http:// | ||
==== Mixing strings and numbers in an array corrupts the numbers ==== | ==== Mixing strings and numbers in an array corrupts the numbers ==== | ||
< | < | ||
- | int SomeArray = { | + | int SomeArray[] = { |
1, | 1, | ||
3.14159, | 3.14159, | ||
Line 19: | Line 25: | ||
ACC incorrectly writes initial array values, resulting in some numbers getting interpreted as string indices and recalculated to avoid string index conflicts between libraries. | ACC incorrectly writes initial array values, resulting in some numbers getting interpreted as string indices and recalculated to avoid string index conflicts between libraries. | ||
+ | |||
+ | This bug only affects non-local arrays and happens randomly, usually only with large arrays. | ||
+ | |||
+ | To avoid this bug, **do not use static initialization with non-local arrays, this includes multidimensional arrays**, instead, declare an empty array and initialize it in a function: | ||
+ | |||
+ | < | ||
+ | int SomeArray[3]; | ||
+ | |||
+ | function void InitArrays() | ||
+ | { | ||
+ | int i = 0; | ||
+ | SomeArray[i++] = 1; | ||
+ | SomeArray[i++] = 3.14159; | ||
+ | SomeArray[i++] = " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Or, in a more beautiful way: | ||
+ | |||
+ | < | ||
+ | int SomeArray[3]; | ||
+ | int SomeArrayCount = 0; | ||
+ | |||
+ | function void AddEntry(int x) | ||
+ | { | ||
+ | SomeArray[SomeArrayCount++] = x; | ||
+ | } | ||
+ | |||
+ | function void InitArray(void) | ||
+ | { | ||
+ | AddEntry(1); | ||
+ | AddEntry(3.14159); | ||
+ | AddEntry(" | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== No " | ||
+ | |||
+ | There is no type called '' | ||