13-05-2010, 09:30 AM
It is common for organisations to raise deviations against Rule 18.4, thereby allowing the use of unions, when including header files that declare machine registers and/or access hardware.
If you choose not to raise a deviation then there are other solutions, including the one suggested by Lundin.
It is possible that your tool is flagging a violation of Rule 8.10 because it does not know about the external definitions of the objects declared in your header file. You could provide stub definitions to your tool in order to provide it with the missing information.
Alternatively your tool may have a flag that you can use to tell it that it does not have full visibility of the project.
If you choose not to raise a deviation then there are other solutions, including the one suggested by Lundin.
It is possible that your tool is flagging a violation of Rule 8.10 because it does not know about the external definitions of the objects declared in your header file. You could provide stub definitions to your tool in order to provide it with the missing information.
Alternatively your tool may have a flag that you can use to tell it that it does not have full visibility of the project.
Posted by and on behalf of the MISRA C Working Group