About Rule 5-0-15 and the size of the 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: About Rule 5-0-15 and the size of the array (/showthread.php?tid=1481) |
About Rule 5-0-15 and the size of the array - Sebastien.Ashby@nxp - 25-03-2019 Hi, I have a question about Rule 5-0-15: "Array indexing shall be the only for of pointer arithmetic". Is the rule satisfied if the code referencing the array element has no knowledge of the dimensions of the array object at compile/link time? For example, in the case where the argument passed to parameter "p2" of "my_fn" is an array whose size is defined at runtime? Code: void my_fn ( uint8_t * p1, uint8_t p2[ ] ) Re: About Rule 5-0-15 and the size of the array - misra cpp - 10-04-2019 Yes, knowledge of the array dimensions is not required |