/* >>>------------------------------------------------------------ * * File: rule_3.1.c, Module: M2CM-3.2-QAC-8.1.2 * * RULE 3.1 (Required): * All usage of implementation-defined behaviour shall be * documented. * * Implemented by messages: * 202 [I] '-' character in '[]' conversion specification is * implementation defined. * * 284 [I] Multiple character constants have implementation * defined values. * * 285 [I] Character constant contains character which is not a * member of the basic source character set. * * 286 [I] String literal contains character which is not a * member of the basic source character set. * * 287 [I] Header name contains character which is not a member * of the basic source character set. * * 288 [I] Source file '%s' has comments containing characters * which are not members of the basic source character set. * * 289 [I] Source file '%s' has preprocessing tokens containing * characters which are not members of the basic source * character set. * * 292 [I] Source file '%s' has comments containing one of the * characters '$', '@' or '`'. * * 299 [I] Source file '%s' includes #pragma directives * containing characters which are not members of the basic * source character set. * * 303 [I] Cast between a pointer to volatile object and an * integral type. * * 305 [I] Cast between a pointer to function and an integral * type. * * 306 [I] Cast between a pointer to object and an integral * type. * * 308 Non-portable cast involving pointer to an incomplete * type. * * 581 [I] Floating-point constant may be too small to be * representable. * * 634 [I] Bit-fields in this struct/union have not been * declared explicitly as unsigned or signed. * * 878 Using wide character or string literals. * * 2850 Constant: Implicit conversion to a signed integer type * of insufficient size. * * 2851 Definite: Implicit conversion to a signed integer type * of insufficient size. * * 2852 Apparent: Implicit conversion to a signed integer type * of insufficient size. * * 2853 Suspicious: Implicit conversion to a signed integer type * of insufficient size. * * 2855 Constant: Casting to a signed integer type of * insufficient size. * * 2856 Definite: Casting to a signed integer type of * insufficient size. * * 2857 Apparent: Casting to a signed integer type of * insufficient size. * * 2860 Constant: Implementation-defined value resulting from * left shift operation on expression of signed type. * * 2861 Definite: Implementation-defined value resulting from * left shift operation on expression of signed type. * * 2862 Apparent: Implementation-defined value resulting from * left shift operation on expression of signed type. * * 2890 Constant: Negative value implicitly converted to an * unsigned type. * * 2895 Constant: Negative value cast to an unsigned type. * * <<<------------------------------------------------------------ */ /* PRQA S 2983,3203,3205 ++ */ #include #include "misra.h" #include "m2cmex.h" #define MSTR "ABC$" /* Implementation Defined */ extern S16 test_0301( void ) { /* Non portable comment - $$$ */ /* Implementation Defined */ wchar_t wch = L'ab'; /* Implementation Defined */ PC bufc[] = "abc$"; /* Implementation Defined */ S16 sra; S16 srb; S16 sia; struct x; struct x * ptr; ptr = (struct x*)&sra; /* Implementation Defined */ if (s16a > 0x6000) { s16r = s16a << 3; /* Implementation Defined */ } s16b = s16a << 3; /* Implementation Defined */ s16c = 0x7654 << 3; /* Implementation Defined */ sia = 'ab'; /* Implementation Defined */ return 0; }