Page 1 of 1

Rule 19.1 Example

Posted: Wed Jan 22, 2014 7:33 am
by minoru.kanome
rule 19.1 example :

a = b; /* Compliant - exception 1 */

a and b are not overlapping object.
Therefore, this code is improper as the example.
Is it right?

Re: Rule 19.1 Example

Posted: Mon Feb 03, 2014 8:29 am
by misra-c
Thank you for bringing this to our attention. You are correct to say that the line "a=b" is not a relevant example for this rule and there is no overlap between a and b.

The "*p = *q" is a correct example of exception 1, as would be the following

Code: Select all

  union 
  {
    int16_t i;
    int32_t j;
    int16_t k;
  }a = {0};
  a.i = a.k;   /* Compliant - exception 1 */