[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:2012 Rules applicable to message 3334:

Rule-5.3  (Required) An identifier declared in an inner scope shall not hide an identifier declared in an outer scope


See also:

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