MATLAB: How to force Polyspace to ignore null pointer

Polyspace Client for C/C++

I am using a (UINT8)* 0x0 as an absolute address but Polyspace errors out on this due to null pointer representation.

Best Answer

Polyspace cannot differentiate Null pointer from Absolute adressing.
Note that, this case is referenced at page 315 in the documentation (8.2.20.1.2. The NULL pointer case). In such cases, PolySpace cannot do the difference between the NULL pointer and the absolute address which could become at address 0x0.
Intrusive way proposed with PolySpace directive flag is valid.
#ifdef PolySpace
ComputedCRC = crc32((UINT8 *)0x1000, length, 0xFFFFFFFF);
#else
ComputedCRC = crc32((UINT8 *)0, length, 0xFFFFFFFF);
#endif
The only non intrusive way is to use option -post-preprocessing-command with a script which looks like the one attached (null_addr.pl). It works with the attached example (null.c) and replaces (UINT8 *)0 by (UINT8 *)0x1.