Valid typedef name rule for float/double data type - Printable Version +- MISRA Discussion Forums (https://forum.misra.org.uk) +-- Forum: MISRA C (https://forum.misra.org.uk/forumdisplay.php?fid=4) +--- Forum: MISRA C:2012 and MISRA C:2023 guidelines (https://forum.misra.org.uk/forumdisplay.php?fid=21) +---- Forum: 7.4 Code design (https://forum.misra.org.uk/forumdisplay.php?fid=181) +---- Thread: Valid typedef name rule for float/double data type (/showthread.php?tid=1351) |
Valid typedef name rule for float/double data type - Anitha Rajasekar - 13-06-2017 We are appending some prefix for the typedef name as below typedef float UI_FLOAT_32. It shows the warning for the above line of code as 1. misra_violation: [Advisory] MISRA C-2012 Directive 4.6 violation: typedefs that indicate size and signedness should be used in place of the basic float numerical type. MISRA Violation Typedefs Of Basic Types With Names That Do Not Indicate Size And Signedness MISRA advises compliance with this rule. The same issue is not coming if we use FLOAT32.. Is there any rule for the typedef name used for float and double. Re: Valid typedef name rule for float/double data type - misra-c - 21-09-2017 Guideline 4.6 is a directive rather than a rule. Section 6.1 of the MISRA-C 2012 document says Quote:A directive is a guideline for which it is not possible to provide the full description necessary to perform a check for compliance.As a minimum the name should include the size and in the case of integer types it should include the signedness. Both UI_FLOAT_32 and FLOAT32 meet the requirements for directive 4.6, BUT a tool is permitted to have a different interpretation on what constitutes a non-compliance. |