Hmm possible progress: clang-tidy lcdx.c -- -I"C:\Program Files (x86)\Microchip\xc8\v1.45\include"
Error while processing C:\Users\Oliver\Documents\MPLAB\rfg_fpa.X\lcdx.c.error: too many errors emitted, stopping now [clang-diagnostic-error]C:\Program Files (x86)\Microchip\xc8\v1.45\include\__size_t.h:4:18: error: typedef redefinition with different types ('unsigned int' vs 'unsigned long long') [clang-diagnostic-error]typedef unsigned size_t; /* type yielded by sizeof */
lcdx is one file of my project. Now I think I have to feed it a PIC type in order to generate valid symbols for ports, tris etc.
clang-tidy lcdx.c -- -I"C:\Program Files (x86)\Microchip\xc8\v1.45\include" -D__XC -D__XC8 -D__XC__ -D__XC8__ -D__18F4520 -D__18F4520__ -D_18F4520 -D__XC -D__XC8 -D__PICC18__ -D_MPC_ -D_PIC18
pic18f4520.h:50:46: error: expected ';' after top level declarator [clang-diagnostic-error]
extern volatile unsigned char PORTA @ 0xF80;
So now it is choking on the at sign. It also doesn't like a whole bunch of types, but they can probably be hidden by defining them
Further to the above I've installed CPPCHECK. It has a GUI, so it is relatively easy to set up.
I would recommend putting the CPPCHECK project in the folder above the actual project. Despite the name it appears to test C code as well, and it appears to ignore undefined symbols so you can run it on PIC C code without having to tweak it to process the header. I presume the assumption is that it won't check for basic errors that any compiler would pick up.
post edited by oliverb - 2019/11/23 11:14:50