Lila - 2022-11-10
// cppcheck-suppress[misra-c2012-21.6]
#include <stdio.h>

typedef FILE *(*fopen_T)(const char *filename, const char *mode);

// MISRA C:2012 Rule 8.4
extern fopen_T fopen_fn;
fopen_T fopen_fn = &fopen;  // Function pointer to `fopen()`

void myFileOpen(const char *inFileName, const char *inMode);

void myFileOpen(const char *inFileName, const char *inMode) {
    fp = fopen_fn(inFileName, inMode);
    // ...
}

The lines below trigger mandatory rule 22.5.

extern fopen_T fopen_fn;
fopen_T fopen_fn = &fopen;  // Function pointer to `fopen()`

I think that this is false positive.