I maintain some embedded C code (No OS). I have made some updates an run CPPCheck on my changes.
CPPCheck has brought up the error 'Null pointer dereference: (volatile unsigned int*)0'. This is not in my code changes but I am keen to understand what is going on. As far as I understand the behaviour of dereferencing a null pointer is undefined.
'''
typedef void (*pfFunc_T)( void );
/* restart bootloader */
pfFunc_T pfFunc;
__interrupt_disable();
pfFunc = (pfFunc_T)( ( *(volatile U32*)0 ) ); /*CPPCheck error*/
if ( pfFunc != NULL ) /* no program loaded */
{
pfFunc();
}
'''
It is memory mapped and the boot loader is first. Could it be calling the boot loader from a different application?