Free static check for HiTech / Microchip C?

I write a lot of code for the HiTech C compiler. I am sure that my code will benefit from static verification, for example splint , but the bus itself works on some HiTech extensions, for example, cp0and sfr. However, I cannot just say that the bus skips the HiTech headers, because then it does not know who the majority of my identifiers are from.

Does anyone know a static check that can handle this?

Added: examples of extensions: Basically, these are only new type classifiers and absolute addressing, for example.

extern volatile cp0 unsigned int cp0_Config @ __REGADDR(16,0);
extern volatile sfr unsigned long OC2R @ 0xBF803210;

(There is also a type specifier persistent.)

There are also qualifiers interruptand fastfor the functions:

void interrupt ExceptionHandler(void) @GENERAL_EXCEPTION
{
    ...
}

Added:

, , , . script SED, "... @...;"

splint -D__32MX460F512L__ -Dsfr= -Dcp0= -Dmips32r2= -I ~/HiTechStripped mymodule.c

:

< Location unknown >: Field name reused: 
  Code cannot be parsed.  For help on parse errors, see splint -help
  parseerrors. (Use -syntax to inhibit warning)
< Location unknown >: Previous use of 
< Location unknown >: Previous use of 
< Location unknown >: Previous use of
[this goes on for about 100 lines...]

:

../../../../HiTechStripped/stdlib.h:140:39: mismatched parentheses in #if
  Preprocessing error. (Use -preproc to inhibit warning)

, :

#if defined(_XA_) && sizeof(double) == 8

, , , . .

+3
3

, HiTech . HiTech PIC18. , .

+2

, Cppcheck .

+1

, , , checker, STATIC_ANLAYSIS, , . -, .

I am not familiar with the compiler or its extensions; perhaps if you would give a few examples, could concrete work be proposed?

0
source

Source: https://habr.com/ru/post/1730493/


All Articles