Set up NeoVim on Linux for C development

This even (mostly) works for retro systems! With Conquer of Completion installed:

  • Install clangd
  • In Vim, :CocInstall coc-clangd

Local references to headers and comments on functions work. Doxygen on macros don't seem to work, though.


Unit test on retro machines works on IBM PC and Amiga.

Amiga config

With SAS/C: sc link math=standard lib_test.c lib.c cutest/CuTest.c link. If your linker is complaining about __CXC55, linking to the standard math library is needed.

Increase the stack size before running tests. There's a big char variable defined as the buffer for the string output that will make smaller stacks fail. On the Amiga: stack 32000 then run the command. On Vamos, vamos -s 32 command.


Recast a void star pointer to be used to fill another data type

If you want to take a void pointer then use it for building a structure of objects of the same data size, recast it:

void *myRAM;
// allocate the ram
short *shortInterface = (short *)myRAM;
shortInterface++; //=> incremented by 2