BUG: Running a Program in NMAKE Fails During PreprocessingLast reviewed: July 22, 1997Article ID: Q116420 |
1.20 1.30 1.40
MS-DOS
kbtool kberrmsg kbbuglist
The information in this article applies to:
SYMPTOMSWhen running NMAKE on a makefile that executes an external program during preprocessing with the bracket ("[]") syntax, you get the following error message:
fatal error U1023: syntax error in expression Stop. CAUSEThe bracket syntax does not work in NMAKE if the expression being evaluated uses either the subtraction operator ("-") or the bitwise XOR operator ("^").
STATUSMicrosoft has confirmed this to be a bug in the Microsoft Program Maintenance Utility (NMAKE), versions 1.2, 1.3, and 1.4. This syntax is no longer documented and it is not supported in Visual C++ for Windows version 1.51 or Visual C++ 32-bit Edition.
MORE INFORMATIONThe bracket syntax can be used to have NMAKE run a program during preprocessing of a makefile. NMAKE replaces the program specification in the makefile with the program's return code. For example, if "Test" is a program that has a return code of 1, after preprocessing, the makefile NMAKE would change the expression
!IF [Test] != 0to the following:
!IF 1 != 0The sample code below can be used to duplicate the problem with the bracket syntax and the subtraction and bitwise XOR operators. To reproduce the problem, build the Test program (which simply returns the integer value it has been passed on the command line) and then run NMAKE on the sample makefile.
Sample Code
/* TEST.CPP Compile options needed: none */ #include <stdio.h> #include <stdlib.h> int main( int argc, char ** argv ) { return atoi( argv[1] ); } # MAKEFILE # # Command line options needed: none # # The expression [Test 4] - 4 should be preprocessed to be # 4 - 4, which evaluates to 0 or false. However, NMAKE issues # the U1023 error instead. all: !IF [Test 4] - 4 @echo Expression evaluated to true !ELSE @echo Expression evaluated to false !ENDIF |
Additional reference words: 1.20 1.30 1.40 exclusive
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |