MISRA.INCL.TGMATH.2012MISRA C 2012 Rule 21.11: The standard header file <tgmath.h> shall not be usedCategory: Required Analysis: Decidable, Single Translation Unit Applies to: C99 AmplificationNone of the facilities that are specified as being provided by <tgmath.h> shall be used. RationaleUsing the facilities of <tgmath.h> may result in undefined behaviour. LimitationOn Windows (Visual Studio), it is possible to compile without including tgmath.h but using its facilities - Windows assumes that the <tgmath> file is missing and includes it anyway. This is a known limitation; the checker won't report on calling functions from these headers in this case as tgmath has methods from math.h and complex.h headers. Example#include <tgmath.h> /* Non-compliant */ float f1, f2; void f ( void ) { f1 = sqrt ( f2 ); /* Non-compliant - generic sqrt used */ } #include <math.h> float f1, f2; void f ( void ) { f1 = sqrtf ( f2 ); /* Compliant - float version of sqrt used */ } |