PRB: Functions in Function Prototypes Can't Have Typedef Args

ID Number: Q67080

5.10 6.00 6.00a 6.00ax | 5.10 6.00 6.00a

MS-DOS | OS/2

buglist5.10 buglist6.00 buglist6.00a buglist6.00ax fixlist7.00

Summary:

SYMPTOMS

In Microsoft C versions 5.1, 6.0, 6.0a, and 6.0ax, the following

error may be incorrectly generated:

error C2061: syntax error : identifier 'SecondType'

CAUSE

According to the ANSI specification, types and typedefs should both

be able to exist interchangeably in function prototypes, and the

Microsoft C and QuickC compilers do allow function prototypes to

include typedefs in the parameter type list. However, the compilers

do not allow parameters to functions or function pointers within

the type list to have typedef'd parameters. For example, given the

following declarations

typedef int FirstType;

typedef int SecondType;

int func( int, FirstType, int *( SecondType ) );

the compilers have no problem with "FirstType," but they will halt

with an error when they reach "SecondType".

STATUS

Microsoft has confirmed this to be a problem in C versions 5.1,

6.0, 6.0a, and 6.0ax and QuickC versions 2.0, 2.01, 2.5, and 2.51

(buglist2.00, buglist2.01, buglist2.50, and buglist2.51). This

problem was corrected in C/C++ version 7.0.

Additional reference words: 2.00 2.50 5.10 6.00 6.00a 6.00ax