The following Errors accured when complied with OpenWatcom 1.9.
Open Watcom C32 Optimizing Compiler Version 1.9
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
assemble.c(792): Error! E1063: Missing operand
assemble.c(792): Warning! W111: Meaningless use of an expression
assemble.c(792): Error! E1009: Expecting ';' but found 'struct'
assemble.c(792): Error! E1058: Cannot use typedef 'operand' as a variable
assemble.c(792): Error! E1011: Symbol 'opx' has not been declared
assemble.c(792): Warning! W111: Meaningless use of an expression
assemble.c(802): Warning! W102: Type mismatch (warning)
assemble.c(802): Note! N2003: source conversion type is 'struct operand *'
assemble.c(802): Note! N2004: target conversion type is 'int '
assemble.c(820): Warning! W102: Type mismatch (warning)
assemble.c(820): Note! N2003: source conversion type is 'int '
assemble.c(820): Note! N2004: target conversion type is 'struct operand const *'
assemble.c(851): Error! E1033: Expression for '->' must be 'pointer to struct or
union'
assemble.c(852): Error! E1033: Expression for '->' must be 'pointer to struct or
union'
assemble.c(890): Error! E1033: Expression for '->' must be 'pointer to struct or
union'
assemble.c(891): Error! E1033: Expression for '->' must be 'pointer to struct or
union'
assemble.c: 2277 lines, included 9380, 4 warnings, 8 errors
Error: Compiler returned a bad status compiling "assemble.c"
In nasm.h, there is a following structure statement. I think the reason is that the same two word "operand" are used. So I advice the developers to change one of the word to avoid this kind of error for some compilers.
typedef struct operand { /* operand to an instruction */
int32_t type; /* type of operand */
int disp_size; /* 0 means default; 16; 32; 64 */
enum reg_enum basereg, indexreg; /* address registers */
int scale; /* index scale */
int hintbase;
enum eval_hint hinttype; /* hint as to real base register */
int32_t segment; /* immediate segment, if needed */
int64_t offset; /* any immediate number */
int32_t wrt; /* segment base it's relative to */
int eaflags; /* special EA flags */
int opflags; /* see OPFLAG_* defines below */
} operand;
Best regards.
I'm not getting this error compiling with OW 1.9 on a Windows host. I regularly compile 2.10rc1 and newer NASM versions. The "typedef struct operand {...} operand;" construct in nasm.h looks the same there.