MISRA Discussion Forums
Rule 7.0.5 Example potential typo - Printable Version

+- MISRA Discussion Forums (https://forum.misra.org.uk)
+-- Forum: MISRA C++ (https://forum.misra.org.uk/forumdisplay.php?fid=18)
+--- Forum: MISRA C++:2023 guidelines (https://forum.misra.org.uk/forumdisplay.php?fid=188)
+---- Forum: 4.7 Standard conversions (https://forum.misra.org.uk/forumdisplay.php?fid=193)
+---- Thread: Rule 7.0.5 Example potential typo (/showthread.php?tid=1677)



Rule 7.0.5 Example potential typo - danix800 - 21-03-2024

```c
constexpr int32_t fn( int32_t i )
{
  return i * i;
}

u8 + fn( 10 )   // Compliant by exception #1
```

Is u8 a typo? Reasonable one might be 'u32 + fn(10)'?

u8 << 2 is non-compliant, so should u8 + f(10), this should be a typo.


RE: Rule 7.0.5 Example potential typo - misra cpp - 12-04-2024

Yes, you're right - we'll correct the example to:  u32 + fn(10)  in the next version