[previous] MISRA C:2012  Rule-11.7:  (Required) [next] A cast shall not be performed between pointer to object and a non-integer arithmetic type

Amplification:

For the purposes of this rule a non-integer arithmetic type means one of:

Example Code:


#pragma PRQA_MESSAGES_OFF 1056,3112

#include "misra.h"
#include "m3cmex.h"

extern int16_t rule_1107( void )
{
    int16_t *pi = &sia;

    (_Bool)   pi;                       /* 0361           */
    (char)    pi;                       /*      0306 0309 */
    (N1)      pi;                       /*      0306      */
    (float32_t) pi;                     /* 0301           */

    (int16_t *)bla;                     /* 0362           */
    (int16_t *)pca;                     /*      0306      */
    (int16_t *)n1a;                     /*      0306      */
    (int16_t *)fta;                     /* 0301           */

    return 0;
}


QAC messages that encompass this guideline:

0301 [u] Cast between a pointer to object and a floating type.


Related rules:

Rule-1.3 There shall be no occurrence of undefined or critical unspecified behaviour



(c) The Motor Industry Research Association, 2012
QA C Source Code Analyser 8.1.2
MISRA C:2012 Compliance Module 1.0
© 2013 Programming Research
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index Contents