Forum Discussion
Altera_Forum
Honored Contributor
11 years agoUsing macros is always OK. They just expand to C code that can be reviewed on its own. What is acceptable for code review depends on what the customer and certification authority demands. For safety critical applications, macros are usually not accepted unless they are processed by a qualified pre-processor. For DO-178 we used macros and did the code review of the expanded macros as shown in the pre-processor output. Of course we have the original source files available for reference.
The __builtin_* directives expand to assembler instructions. You will need to have your code reviewers examine the object code and verify that the correct translation occurred. Alternatively, I've heard some company sells a tool qualification package for the GCC pre-processor. Sorry, but I don't know who makes it or even if it is still available. As with everything on the net, take this advice with several grains of salt.