PRB: Missing Closing ")" in Macro Causes Unexpected EOFLast reviewed: July 24, 1997Article ID: Q42019 |
The information in this article applies to:
SYMPTOMSThe compiler generates the following error:
C1057 unexpected EOF in macro expansion ( missing ')'? ) -or- fatal error C1057: unexpected end of file in macro expansion CAUSEThis behavior is by design. It informs the user of a syntax error.
RESOLUTIONExamine the code line indicated by the compiler error. Ensure that the macro is used properly with both opening and closing parentheses and all parameters required.
MORE INFORMATION
Sample CodeThe following sample code generates the error:
/* Compile options needed: none */ #include <stdio.h> #define add(wx, wy) (wx) + (wy) void main( ) { int i; i = add( 1, 2 ); printf( "i = %d\n", i ); i = add( 1, 2 ; /* missing ')' */ printf( "Hello World\n" ); for( i = 0; i < 10; i++ ) { printf( "i + 10 = %d\n", add( i, 10 ) ); } } |
Additional query words: 8.00 8.00c 9.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |