﻿# V2605\. MISRA\. Features from <tgmath\.h\> should not be used\.

This diagnostic rule is based on the [MISRA](https://www.misra.org.uk/) \(Motor Industry Software Reliability Association\) software development guide\.

This rule only applies to programs written in C\. Functions or macros from the '<tgmath\.h\>' header file should not be used\. They may lead to undefined behavior\.

Look at the example:

```cpp
void bar(float complex fc)
{
  ceil(fc); // undefined behavior
}
```

The 'ceil' function call with an actual argument of the 'float complex' type leads to undefined behavior because the [standard library](https://en.cppreference.com/w/c/numeric/complex) does not contain a specialized version with such formal parameter type\.

If a specialized function exists, it should be used to avoid such situations:

```cpp
#include <tgmath.h>

float foo(float x)
{
  return sin(x);
}
```

For the 'sin' function, a specialized version with a formal argument of the 'float' type \- 'sinf' type exists:

```cpp
#include <math.h>

float foo(float x)
{
  return sinf(x);
}
```