wswan:bugs
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| wswan:bugs [2024/02/18 08:30] – asie | wswan:bugs [2026/11/07 22:04] (current) – asie | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Known bugs ====== | + | ====== Known bugs and limitations |
| - | ===== gcc-ia16 ===== | + | ===== C compiler (gcc-ia16) ===== |
| - | * In general, gcc-ia16' | + | * In general, |
| + | * gcc-ia16' | ||
| + | * gcc-ia16' | ||
| + | * The optimization levels '' | ||
| ==== Miscompilations involving far function pointers ==== | ==== Miscompilations involving far function pointers ==== | ||
| - | In some cases, when calling pointers from arrays of far function pointers in optimization modes >= -O1, the code will be miscompiled. This is a [[https://github.com/ | + | In some cases, when calling pointers from arrays of far function pointers in optimization modes >= -O1, the code will be miscompiled. This is a [[https://codeberg.org/ |
| - | One can work around this by annotating the affected function to be compiled without optimizations: | + | One can work around this by annotating the affected function to be compiled without optimizations. In particular, one can create a separate function that //only// acts as a wrapper for the function call: |
| <code C> | <code C> | ||
| - | __attribute__((optimize(" | + | __attribute__((noinline, |
| void call_to_my_function_table(uint8_t index) { | void call_to_my_function_table(uint8_t index) { | ||
| my_function_table[index](); | my_function_table[index](); | ||
| } | } | ||
| </ | </ | ||
| + | |||
| + | ==== Far pointers to near variables ==== | ||
| + | |||
| + | <code C> | ||
| + | struct a { void __far *ptr; }; | ||
| + | struct b { int value; }; | ||
| + | struct b instance_b; | ||
| + | |||
| + | // This doesn' | ||
| + | const struct a var_ptr = { & | ||
| + | |||
| + | // ... but this does | ||
| + | const struct a var_ptr_fixed = { __builtin_ia16_static_far_cast(& | ||
| + | |||
| + | // This doesn' | ||
| + | const struct a field_ptr = { __builtin_ia16_static_far_cast(& | ||
| + | |||
| + | // ... but this does | ||
| + | const struct a field_ptr_fixed = { & | ||
| + | </ | ||
| + | |||
| + | ==== wswan/ | ||
| + | |||
| + | The wswan/ | ||
| + | |||
| + | * using '' | ||
| + | * building with '' | ||
| + | |||
| + | The wwitch target also prohibits defining far functions outside of the default text section, but this only becomes an issue if the FreyaBIOS system APIs ('' | ||
wswan/bugs.1708245053.txt.gz · Last modified: by asie
