/char

midl /char signed | unsigned | ascii7 }

signed

Specifies that the default C-compiler type for char is signed. All occurrences of char not accompanied by a sign specification are generated as unsigned char.

unsigned

Specifies that the default C-compiler type for char is unsigned. All uses of small not accompanied by a sign specification are generated as signed small.

ascii7

Specifies that all char values are to be passed into the generated files without a specific sign keyword. All uses of small not accompanied by a sign specification are generated as small.

 

Examples

midl /char signed filename.idl

midl /char unsigned filename.idl

midl /char ascii7 filename.idl

 

Remarks

The /char switch helps you ensure that the MIDL compiler and C compiler operate together correctly for all char and small types. By definition, MIDL char is unsigned. Small is defined in terms of char (#define small char), and MIDL small is signed.

The /char switch directs the MIDL compiler to specify explicit signed or unsigned declarations in the generated files when the C-compiler sign declaration conflicts with the MIDL default for that type.

The following table summarizes the generated types:

midl /char option

Generated char type

Generated small type

midl /char signed

unsigned char

small

midl /char unsigned

char

signed small

midl /char ascii7

char

small

 

The /char signed option indicates that the C-compiler char type is signed. To match the MIDL default for char, the MIDL compiler must convert all uses of char not accompanied by a sign specification to unsigned char. The small type is not modified because this C-compiler default matches the MIDL default for small.

The /char unsigned option indicates that the C-compiler char type is unsigned. The MIDL compiler converts all uses of small not accompanied by a sign specification to signed small.

The ascii7 option indicates that no explicit sign specification is added to char types. The type small is generated as small.

To avoid confusion, you should use explicit sign specifications for char and small types whenever possible in the IDL file. Note that the use of explicitly signed char types in your IDL file is not supported by DCE IDL. Therefore, this feature is not available when you compile with the MIDL /osf switch.

For more information related to /char, see small18DM2WC.

See Also

char, General MIDL Command-line Syntax, /osf, small