Article ID: 111500 - Last Review: October 14, 2003 - Revision: 1.1 BUG: Trailing Commas May Cause Incorrect Error MessagesThis article was previously published under Q111500 On This PageSYMPTOMS
If extra trailing commas are placed at the end of a data declaration
statement, the Microsoft Macro Assembler (MASM) may generate incorrect
error messages, which can include:
error A2207: missing right parenthesis in expression error A2081: missing operand after unary operator error A2206: missing operator in expression error A2050: real or BCD number not allowed RESOLUTION
If an error message seems incorrect, check the indicated line and the
surrounding lines for extra or improperly placed commas.
STATUS
Microsoft has confirmed this to be a problem in MASM versions 6.1x. We
are researching this problem and will post new information here in the
Microsoft Knowledge Base as it becomes available.
MORE INFORMATION
The expected error message for extra commas at the end of a data
declaration statement is:
error A2009: syntax error in expression
If there is a single trailing comma and the following line is blank or a comment then no error is reported. The trailing comma indicates that the data on the following line should be concatenated to the previous data. A blank or comment line is ignored by MASM and so nothing is done. However, if a single comma occurs and the next line is not blank or a comment and does not contain correct data for the type being allocated, the correct error will be generated. For example
error A2008: syntax error : nop
Sample CodeAPPLIES TO
| Article Translations
|

Back to the top
