I'm currently developing a program to simulate a small microprocessor. When I compile the program using
gcc -ansi make_firmware.c -o make_firmware
the system reports the following solitary error:-
In file included from make_firmware.c:3:0:
make_firmware.h:53:14: error: variably modified ‘instr_table’ at file scope
Now, my .h file contains the following:-
- Code: Select all
typedef struct instrRecord
char * cmdStr;
/* Maximum number of instruction records. */
const int max_records = 151;
/* Table of all assembly language instructions. */
INSTR_RECORD instr_table[max_records]; /* line 53 of .h file */
The array instr_table has data inserted into its fields in the .c file.
Could someone please explain why this error was generated and possibly point me in the direction of a solution?
Thanks in advance for any help that you may be able to give with this.