[previous] 3334 [next] This declaration of '%s' hides a more global declaration.
Declarations and definitions

This declaration will 'hide' an ordinary identifier declared previously at a wider scope. The previous declaration will remain hidden for the remainder of this scope. Usage of this identifier which might be intended to refer to the previous one will now refer to the local one.

This could be the result of trying to use the same identifier for more than one purpose. Objects, functions, typedefs and enumeration constants all share a common name space. Hiding of identifiers is confusing and dangerous and should be avoided.

For example:


/*PRQA S 2017,3210,3205,3408,3447 ++*/

extern int press;

void foo(void)
{
    float press;               /* Message 3334 */
}


MISRA-C:2004 Rules applicable to message 3334:

Rule  5.2  (Required) Identifiers in an inner scope shall not use the same name as an identifier in an outer scope, and therefore hide that identifier.


See also:

QA·C Source Code Analyser 8.1
MISRA-C:2004 Compliance Module 3.2
© 2012 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index Contents