ID Number: Q31556
5.00 5.10 | 5.10
MS-DOS | OS/2
buglist5.00 buglist5.10 fixlist6.00
Summary:
The C version 5.00 and 5.10 compilers either hang or produce the
following internal compiler error when the sample program below is
compiled with the default compile options:
fatal error C1001: Internal Compiler Error
(compiler file '@(#)code.c:1.46',line 500)
Contact Microsoft Technical Support
The error is a result of incorrectly declaring an enum type within the
function prototype.
To work around the problem, declare the enum type before declaring the
function prototype.
Microsoft has confirmed this to be a problem in C versions 5.00 and
5.10. This problem was corrected in C version 6.00.
Sample Code
-----------
#include <process.h>
#include <stdlib.h>
#include <string.h>
/* Uncommenting these declarations will resolve the problem:
enum BEEP { BEEP_silent, BEEP_quiet,
BEEP_normal, BEEP_loud } type;
extern void sys_setbeep( BEEP a );
*/
extern void sys_setbeep(enum BEEP { BEEP_silent, BEEP_quiet,
BEEP_normal, BEEP_loud } type );
extern void setpgm(char *name);
extern void userror(char *cs,...);
extern int isnewer(char const *file1, char const *file2);
#ifndef noassert /* otherwise get allocation > 64K errors */
main(int argc, char *argv[])
{
setpgm(argv[0]);
if (argc < 4)
userror("too few arguments");
switch (isnewer(argv[1], argv[2]))
{
case -1:
userror("%s does not exist",argv[1]);
case 0:
return(0);
case 1:
execvp(argv[3], &argv[3]);
userror("unable to execute command '%s' : %s",argv[3],
strerror(errno));
return(3);
}
}
#endif