Monday, March 22, 2010

Do not reuse typedef names




Do not reuse typedef names (misra2004_5_3_DoNotReuseTypedefNames.rule)


Description

Typedef names shall not be reused.

Benefits:

Reuse of typedef names can lead to errors and confusion.

Example:

typedef int MyInt;
void foo()
{
 double MyInt;  /* Violation */
}

Repair:
typedef int MyInt;
void foo()
{
 double MyVar;  /* OK */
}

References:

MISRA-C:2004 Guidelines for the use of the C language in critical systems

Chapter 6, Section 5

Author
ParaSoft



No comments:

Post a Comment

Labels