[C-safe-secure-studygroup] Implement Misra C Rule 2.3 A project should not contain unused type declarations by GCC
Charles.Wilson at draeger.com
Thu Jul 26 13:36:05 BST 2018
The gcc compiler has no means of warning for non-scoped (function) type aliasing.
MISRA C 2.3 is advisory.
As noted in the standard, it speaks to a matter of clarity.
That being said, <stdint.h> contains dozens of aliases, most of which are never used in the vast majority of code.
Within the scope of a function the rule make sense as its scope is limited.
From: C-safe-secure-studygroup [mailto:c-safe-secure-studygroup-bounces at lists.trustable.io] On Behalf Of ?? ?
Sent: Thursday, July 26, 2018 1:03 AM
To: c-safe-secure-studygroup at lists.trustable.io
Subject: [C-safe-secure-studygroup] Implement Misra C Rule 2.3 A project should not contain unused type declarations by GCC
I try to implement rule 2.3 of Misra C by GCC.
I use the warning option -Wunused-local-typedefs to implement.
I am successful when the typedef is used in the function,
but not successful when the typedef is used outside the function.
How should I do ?
This communication contains confidential information. If you are not the intended recipient please return this email to the sender and delete it from your records.
Diese Nachricht enthaelt vertrauliche Informationen. Sollten Sie nicht der beabsichtigte Empfaenger dieser E-mail sein, senden Sie bitte diese an den Absender zurueck und loeschen Sie die E-mail aus Ihrem System.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the C-safe-secure-studygroup