BUG: H2INC Produces Garbage/GP Faults w/ Some Function Typedefs

ID: Q72853


The information in this article applies to:
  • Microsoft H2INC Utility for MS-DOS, version 1.0
  • Microsoft H2INC Utility for OS/2, version 1.0


SYMPTOMS

Under certain circumstances, the Microsoft C to MASM Include File Translator (H2INC) version 1.0 that ships with the Microsoft Macro Assembler (MASM) version 6.0 may generate invalid results for certain C include files with function typedefs. Under MS-DOS, the result may be garbage characters in the generated .INC file. Under OS/2, H2INC may cause a general protection violation (GP Fault).

The problem occurs in this file only when all the following conditions are true:

  • Two consecutive typedefs in the file are used to define functions.


  • The total argument count for the two typedefs is 10 or more.


  • The last argument to the first function typedef is a far pointer.



RESOLUTION

To work around this behavior, define a dummy typedef between the two typedefs that will keep the argument count below 10.


STATUS

Microsoft has confirmed this to be a problem in H2INC version 1.0 which is included with MASM version 6.0. This problem was corrected in H2INC version 1.0 which is included with MASM version 6.0a.


MORE INFORMATION

The sample header file below may be used to illustrate this problem. Garbage characters will appear in the resulting .INC file.

Sample Code


/* Command line options needed: none
*/ 
typedef void Func1Def(int, int, int, int, void _far *);
// typedef void DummyFunc(int, int, int);  // Uncomment for workaround
typedef void Func2Def(int, int, int, int, int);

struct FuncStruct
{
   int arg1;
   Func1Def * Func1;
   Func2Def * Func2;
} FuncStruct; 

Additional query words: 6.00 1.00 buglist1.00 s_utility h_h2inc fixlist1.00

Keywords :
Version : OS/2:1.0; winnt:1.0
Platform : OS/2 winnt
Issue type :


Last Reviewed: January 4, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.