15-05-2018, 10:09 PM
Hello,
Please consider the following case:
Could you confirm if the intent that this should be a violation of the rule since we are passing a non-array as an argument where an array is expected? I ask only because there is related wording in the C90/99 standard under additive operators that states:
Thank you for your help.
Best Regards,
-Greg
Please consider the following case:
Code:
#include
extern void f(int32_t x[1]);
int32_t glob;
extern void test(void);
void test(void)
{
f(&glob); /* Allowed under MISRA C 2012 R17.5? */
}
Could you confirm if the intent that this should be a violation of the rule since we are passing a non-array as an argument where an array is expected? I ask only because there is related wording in the C90/99 standard under additive operators that states:
Quote:For the purposes of these operators, a pointer to a nonarray object behaves the same as a
pointer to the first element of an array of length one with the type of the object as its element
type.
Thank you for your help.
Best Regards,
-Greg
<t></t>