This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
acc [2017/07/09 11:11] – korshun | acc [2017/07/14 19:23] (current) – korshun | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | {{tag> | ||
====== ACC ====== | ====== ACC ====== | ||
ACC is the official ACS compiler. | ACC is the official ACS compiler. | ||
Alternative ACS compilers: [[BCC]], [[GDCC]]. | Alternative ACS compilers: [[BCC]], [[GDCC]]. | ||
+ | |||
+ | * **GitHub**: https:// | ||
===== Known bugs ===== | ===== Known bugs ===== | ||
Line 28: | Line 31: | ||
This bug only affects non-local arrays and happens randomly, usually only with large arrays. | 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**, instead, declare an empty array and initialize it in a function: | + | To avoid this bug, **do not use static initialization with non-local |
< | < | ||
Line 41: | Line 44: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | 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(" | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== Strange compiler crash (ACC 1.56 beta Windows build only) ==== | ||
+ | |||
+ | < | ||
+ | #include " | ||
+ | |||
+ | function int f(void) | ||
+ | { | ||
+ | while (0) | ||
+ | continue; | ||
+ | return 0; | ||
+ | } | ||
+ | |||
+ | function int g(void) | ||
+ | { | ||
+ | while (0) | ||
+ | continue; | ||
+ | return 0; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | This code causes the compiler to enter an infinite loop. Any of the following fixes the issue: | ||
+ | |||
+ | * Removing one of the functions | ||
+ | * Removing '' | ||
+ | * Replacing '' | ||
+ | |||
+ | But the following does not: | ||
+ | * Changing the loop condition | ||
+ | * Replacing '' | ||
+ | * Adding more code before and after continue, both inside and outside the loop | ||
+ | * Adding more functions anywhere else | ||
+ | * Replacing " | ||
+ | |||
+ | ==== Local variable names can conflict with global names ==== | ||
+ | |||
+ | < | ||
+ | #define SOMENAME1 1 | ||
+ | int somename2 = 2; | ||
+ | function void somename3(void) {} | ||
+ | |||
+ | function f(int somename1) // ERROR | ||
+ | { | ||
+ | int somename2; // ERROR | ||
+ | int somename3; // ERROR | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Local variables can't have the same names as any global names (function, constant, variable names). Unlike other compilers, local variable names don't shadow the global names, but trigger a compiler error. | ||
==== No " | ==== No " |