18-08-2015, 02:47 PM
Hello,
I would like to confirm the following interpretation of the rule 8.5. The rule says that "Header files should be used to declare objects, functions, typedefs, and macros. Header files shall not contain or produce definitions of objects or functions (or fragment of functions or objects) that occupy storage."
I have seen a couple of alerts in code raised when the header file contains a macro that generates the "body of one function". My understanding is that this is the case where the "macro produces definitions of objects or functions", and that this is a violation to be corrected.
In a similar way, if the header file contains a #typedef for an struct, should it be considered a violation to this rule?
Thanks in advance.
I would like to confirm the following interpretation of the rule 8.5. The rule says that "Header files should be used to declare objects, functions, typedefs, and macros. Header files shall not contain or produce definitions of objects or functions (or fragment of functions or objects) that occupy storage."
I have seen a couple of alerts in code raised when the header file contains a macro that generates the "body of one function". My understanding is that this is the case where the "macro produces definitions of objects or functions", and that this is a violation to be corrected.
In a similar way, if the header file contains a #typedef for an struct, should it be considered a violation to this rule?
Thanks in advance.
<t></t>