05-01-2006, 08:43 AM
Hi,
i compiled the following code using a misra checking compiler
unsigned char data[1];
memset(&data,0x00,sizeof(data));
after compilation it was showing two errors violating rule 45 and rule 77
i changed the line as given below.
memset((void*)&data,0x00,sizeof(data));
it removed the error violating 77.
But i couldnot find any way to comply with rule 45
Can any one have any idea to perform the above actions without
violating the rule
i compiled the following code using a misra checking compiler
unsigned char data[1];
memset(&data,0x00,sizeof(data));
after compilation it was showing two errors violating rule 45 and rule 77
i changed the line as given below.
memset((void*)&data,0x00,sizeof(data));
it removed the error violating 77.
But i couldnot find any way to comply with rule 45
Can any one have any idea to perform the above actions without
violating the rule