Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 5-0-19: array of pointer, instead of, pointer to array
#1
Regarding these declarations:
Code:
int8_t * ptr6[ 10 ];
int8_t ** ptr7[ 10 ];

There are two type of explanations used:
  • pointer to array of some data type
  • array of pointer to some data type
I think the former style is more accurate, read more below:

In "Explanation of types" section, it is stated:
Quote:ptr6 is of type pointer to array of int8_t

Actually, it was expected to be stated this way:
ptr6 is of type array of pointer to int8_t

As a comparison, it is stated some lines later that:
Quote:ptr7 is of type array of pointer to pointer to int8_t

which is exactly accurate.

What is your idea?
<t></t>
Reply
#2
As you point out, ptr6 is an array of pointer to int. This will be corrected in the upcoming TC.
Posted by and on behalf of
the MISRA C++ Working Group
Reply
#3
Thanks a lot for the update.
<t></t>
Reply
#4
(noted)
Posted by and on behalf of
the MISRA C++ Working Group
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)