Rule 5-0-19: array of pointer, instead of, pointer to array

Moderators: david ward, misra cpp

Post Reply
fakoor
Posts: 2
Joined: Sat Dec 11, 2010 10:22 am
Company: FAKOOR Innovative Ideas

Rule 5-0-19: array of pointer, instead of, pointer to array

Post by fakoor » Tue Dec 14, 2010 5:35 am

Regarding these declarations:

Code: Select all

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:
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:
ptr7 is of type array of pointer to pointer to int8_t

which is exactly accurate.

What is your idea?

misra cpp
Posts: 148
Joined: Mon Jun 02, 2008 1:55 pm
Company: MISRA

Re: Rule 5-0-19: array of pointer, instead of, pointer to array

Post by misra cpp » Tue Oct 11, 2016 10:49 am

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

fakoor
Posts: 2
Joined: Sat Dec 11, 2010 10:22 am
Company: FAKOOR Innovative Ideas

Re: Rule 5-0-19: array of pointer, instead of, pointer to array

Post by fakoor » Sat Feb 25, 2017 5:11 pm

Thanks a lot for the update.

misra cpp
Posts: 148
Joined: Mon Jun 02, 2008 1:55 pm
Company: MISRA

Re: Rule 5-0-19: array of pointer, instead of, pointer to array

Post by misra cpp » Wed Jan 17, 2018 4:43 pm

(noted)
Posted by and on behalf of
the MISRA C++ Working Group

Post Reply

Return to “6.5 Expressions (C++)”