
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
35 lines
742 B
Plaintext
35 lines
742 B
Plaintext
== Why is this an issue?
|
|
|
|
Conversion of a function pointer to a non-function pointer type causes undefined behaviour. Undefined behaviour may arise if a function call is made using a pointer that is the result of a function pointer conversion.
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,cpp]
|
|
----
|
|
void f ( int32_t )
|
|
{
|
|
( void (*)() ) &f; // Noncompliant, conversion to a function pointer type with different prototype
|
|
( void * ) &f; // Noncompliant, conversion to a non-function pointer type
|
|
}
|
|
----
|
|
|
|
|
|
== Resources
|
|
|
|
* MISRA {cpp}:2008, 5-2-6
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
Remove this hazardous cast from "xxx" to "yyy".
|
|
|
|
|
|
endif::env-github,rspecator-view[]
|