14-01-2016, 08:45 AM
Hello,
if we want to use the same Header files for "C" and "C++" we must use the "extern C" constuct. But the "extern C" construct must be placed before the include of the Header and so our tool reports a MISRA 16-0-1 violation. Is this violation valid? And if so, is there an other solution?
Thank you for help,
Stefan
if we want to use the same Header files for "C" and "C++" we must use the "extern C" constuct. But the "extern C" construct must be placed before the include of the Header and so our tool reports a MISRA 16-0-1 violation. Is this violation valid? And if so, is there an other solution?
Code:
#ifndef _MYHEADER_
#define _MYHEADER_
extern "C"
{
#include "firstheader.h" // MISRA 16-0-1 violation
}
Thank you for help,
Stefan
<t></t>