NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

/H (Restrict Length of External Names)

/Hnumber

By default, the length of external (public) names is 2047 characters. This is true for C and C++ programs. The /H option restricts the length of these names. Using /H can only decrease the maximum allowable length of identifiers, not increase it. A space between /H and number is optional.

If a program contains external names longer than number, the extra characters are ignored. If you compile a program without /H and if an identifier contains more than 2,047 characters, the compiler will generate C1064.

The limit on length includes any compiler-created leading underscore (_) or at sign (@). These characters are part of the identifier and take a significant location.

You may find /H useful:

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 either
   *   error L2025: _func : symbol defined more than once
   *   -or-
   *   error LNK2005: _func already defined in '.obj file'
   *   fatal error LNK1169: one or more multiply defined symbols found
   */

   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.

See Also

Compiler Options | Setting Compiler Options