INF: Clarification of the /H Identifier Length Option

ID Number: Q51724

5.10 6.00 6.00a 6.00ax 7.00 | 5.10 6.00 6.00a

MS-DOS | OS/2

docerr

Summary:

In Microsoft C versions 5.1, 6.0, 6.0a, 6.0ax, and C/C++ version 7.0,

the /H option is used to set the maximum length of identifiers. Using

/H can only decrease the maximum allowable length of identifiers, not

increase it. An identifier declared with the CDECL type has an

underscore (_) appended to the front at compile time. This character

is part of the identifier and takes a significant location. Therefore,

the maximum length of an identifier declared with the standard C

declaration syntax is 32 characters (the compiler limit on page 280 of

the "Microsoft C Optimizing Compiler: User's Guide" for version 5.1

specifies 31 characters, which does not include the underscore).

More Information:

The following example shows how using /H can actually introduce errors

if identifier lengths are limited too much:

/* When compiled with /H5, the following code will produce

the error "L2025: _func : symbol defined more than once." */

void func1(void);

void func2(void);

void main(void)

{

func1();

}

void func1(void)

{

}

void func2(void)

{

}

You must also be careful when using the /H option because of

predefined compiler identifiers. If the maximum identifier length is

too small, certain predefined identifiers will be unresolved as well

as certain library function calls. For example, if the printf function

is used and the option /H5 is specified at compile time, the symbol

_prin will be created in order to reference printf, and this will not

be found in the library.

Additional reference words: 5.10 6.00 6.00a 6.00ax 7.00 S_QUICKC