H2INC Does Not Initialize Variables During Conversion

ID Number: Q73194

1.00 | 1.00

MS-DOS | OS/2

docerr

Summary:

The Microsoft C to MASM Include File Translator (H2INC) can be used to

convert C header files to MASM include files. In most cases, it will

convert all C data types and structures into their MASM equivalent.

However, H2INC version 1.0 will not convert initialized C variables to

initialized MASM variables.

More Information:

Page 441 of the "Microsoft Macro Assembler Programmer's Guide" states

that H2INC will not translate static variables, but fails to mention

that initialized variables are not translated either. When a variable

is initialized in a C header file, H2INC translates it to an external

MASM declaration, rather than creating a MASM declaration with the

initial value.

For example, a C header file of the form

char a = 'a';

int b = 100;

.

.

.

is converted to a MASM include file of the form:

EXTERNDEF a:SBYTE

EXTERNDEF b:SWORD

.

.

.

This limitation is expected behavior for H2INC version 1.0.