BUG: Trailing Commas May Cause Incorrect Error MessagesLast reviewed: February 21, 1995Article ID: Q111500 |
The information in this article applies to:
- Microsoft Macro Assembler for MS-DOS, versions 6.1, 6.1a, and 6.11 - Microsoft Macro Assembler for Windows/NT, version 6.11
SYMPTOMSIf 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 allowedThe message given may depend upon the surrounding code. In some cases the incorrect message is only given when a listing file is generated (the /Fl switch is used). In other cases the error messages may flag the wrong line.
RESOLUTIONIf an error message seems incorrect, check the indicated line and the surrounding lines for extra or improperly placed commas.
STATUSMicrosoft 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 INFORMATIONThe expected error message for extra commas at the end of a data declaration statement is:
error A2009: syntax error in expressionNote that the incorrect errors only occur when more than one trailing comma is used. 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
db "Hello", nopcorrectly generates:
error A2008: syntax error : nopThe following sample illustrates several possible incorrect error messages when assembled with MASM 6.1x. The error messages and their locations are not shown in the sample code as comments because adding the comments will change the behavior of MASM.
Sample Code;Assembly options needed: /c /Fl .model small .data db "1",, db "1", "2",, db "1",, "2", db "1", "2",, "!"end
|
Additional reference words: 6.10 6.10a buglist6.10 buglist6.11 buglist6.20
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |