Q66310: C4093 Can Be Caused by MASM-Style Comments in _asm Code
Article: Q66310
Product(s): See article
Version(s): 6.00 | 6.00
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | buglist6.00 | mspl13_c
Last Modified: 24-OCT-1990
The C4093 (Unescaped NewLine in Character Constant in Inactive Code)
warning message will be generated if a section of code is removed with
the preprocessor (#if, #ifdef, etc.) and a constant spans two lines or
is not completed. The following is an example:
void main(void)
{
#ifdef foo
printf("This is an error\n );
#endif
}
However, the C4093 error can also occur in a MASM-style comment to an
inline assembler instruction. For instance:
void main(void)
{
#ifdef foo
_asm mov ax, 10 ; "Set return code
#endif
}
In this case, if the code hadn't been inactive, the line would not
have been flagged.
Workarounds
-----------
There following are two workarounds:
1. Do not use MASM-style comments. If C-style comments (// or /* */)
are used instead, the error is not generated.
2. Add the closing quotation mark to the line.
Microsoft has confirmed this to be a problem in C version 6.00. We are
researching this problem and will post new information here as it
becomes available.
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.
Copyright Microsoft Corporation 1986-2002.