Length and Case of Identifiers

Some implementations do not support long identifiers. Some allow only 6 characters, while others allow as many as 32. They may report each identifier that exceeds the maximum length or truncate identifiers to a given length. Truncation causes serious problems, especially if you have a number of similarly named variables within the scope of a block of code, such as the following:

double acct_receivable_30_days;

double acct_receivable_60_days;

double acct_receivable_90_days;

double current_interest_rate;

acct_receivable_30_days *= current_interest_rate;

If your target system retains only six significant characters, you will have to rename all your acct_receivable variables.

Case sensitivity also affects portability. C is usually a case-sensitive language. That is, CalculateInterest is not considered the same identifier as calculateinterest. Some systems are not case sensitive, however, so to write portable code, differentiate your identifiers by something other than case.

These problems with identifiers can occur in two locations: the compiler and the linker or loader. Even if the compiler can handle long and case-differentiated identifiers, if the linker or loader cannot, you can get duplicate definitions or other unexpected errors.

Microsoft C Specific

The Microsoft C compiler issues the /NOIGNORECASE command to the Microsoft Segmented-Executable Linker (LINK), specifically instructing it to consider the case of identifiers.