我收到以下错误消息:
./instruction.h:10:3: warning: data definition has no type or storage class
10 | } OperandType;
| ^~~~~~~~~~~
./instruction.h:10:3: warning: type defaults to ‘int’ in declaration of ‘OperandType’ [-Wimplicit-int]
./instruction.h:15:3: error: expected specifier-qualifier-list before ‘OperandType’
15 | OperandType operand1_type;
编译代码时:
typedef enum{
Integer,
Label,
Parameters,
Register,
None
} OperandType;
typedef struct{
OperandType operand1_type;
OperandType operand2_type;
OperandType parameter1_type;
OperandType parameter2_type;
} Instruction;
用这个命令:
gcc -o instruction instruction.c whitespace.o -Wall -ansi -pedantic
我该如何解决这个问题?