MISRA Discussion Forums
Rule 5-0-19: array of pointer, instead of, pointer to array - Printable Version

+- MISRA Discussion Forums (https://forum.misra.org.uk)
+-- Forum: MISRA C++ (https://forum.misra.org.uk/forumdisplay.php?fid=18)
+--- Forum: MISRA C++:2008 rules (https://forum.misra.org.uk/forumdisplay.php?fid=19)
+---- Forum: 6.5 Expressions (C++) (https://forum.misra.org.uk/forumdisplay.php?fid=134)
+---- Thread: Rule 5-0-19: array of pointer, instead of, pointer to array (/showthread.php?tid=797)



Rule 5-0-19: array of pointer, instead of, pointer to array - fakoor - 14-12-2010

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?


Re: Rule 5-0-19: array of pointer, instead of, pointer to array - misra cpp - 11-10-2016

As you point out, ptr6 is an array of pointer to int. This will be corrected in the upcoming TC.


Re: Rule 5-0-19: array of pointer, instead of, pointer to array - fakoor - 25-02-2017

Thanks a lot for the update.


Re: Rule 5-0-19: array of pointer, instead of, pointer to array - misra cpp - 17-01-2018

(noted)