![]() |
![]() |
0302 | ![]() |
||||
![]() | |||||||
| Implicitly undefined | REFERENCE - ISO:C90-6.3.4 Cast Operators - Semantics | ||||||
A cast has been performed from a pointer to function type to a floating type ( or vice versa ). This is meaningless. For example:
/*PRQA S 2017,2211,3199,3203,3227,3408,3672,3673 ++*/
extern void foo(float fta, int (*pfa)(void))
{
float ftb;
int (* pfb)(void);
ftb = (float)pfa; /* Message 0302 */
pfb = (int (*)(void))fta; /* Message 0302 */
}
MISRA C:2012 Rules applicable to message 0302:
| Rule-1.3 (Required) | There shall be no occurrence of undefined or critical unspecified behaviour |
| Rule-11.1 (Required) | Conversions shall not be performed between a pointer to a function and any other type |
![]() | ||
| QA·C Source Code Analyser 8.1
MISRA C:2012 Compliance Module 1.0 © 2012 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index | Contents |