FIX: Return Value Not Ignored with NMAKE's Dash (-) Command

Last reviewed: September 18, 1997
Article ID: Q122220
1.50 1.51 | 1.00 2.00
WINDOWS   | WINDOWS NT
kbtool kbfixlist

The information in this article applies to:

  • Microsoft Program Maintenance Utility (NMAKE.EXE) supplied with:

        - Microsoft Visual C++ for Windows, versions 1.5 and 1.51
        - Microsoft Visual C++, 32-bit Edition, version 1.0 and 2.0
    

SYMPTOMS

When using the dash command (-) in a makefile to turn off error checking for a given command, return values that are greater than 255 will not be ignored. NMAKE will detect an error and the make process will be terminated, as shown below:

   NMAKE : fatal error U1077: 'C:\WINDOWS\SYSTEM32\CMD.EXE' : return
   code '0xYYY'
   Stop.

YYY is the hexadecimal value of the return code from the command that generated the error.

RESOLUTION

Use the !CMDSWITCHES (+/-) I directive to work around this problem. For example:

   !CMDSWITCHES +I
   mylabel:
        mycommand
   !CMDSWITCHES -I

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was fixed in Microsoft Visual C++, 32-bit Edition, version 4.0.

MORE INFORMATION

Sample Code

The following makefile will prematurely terminate after the mycommand statement if an error MYCOMMAND.EXE returns is a value greater that 255. A small MS-DOS- or Windows NT-based console program returning a value can be used as mycommand.

mylabel:

     -mycommand


Additional reference words: 1.50 1.51 1.00 2.00 buglist1.50 buglist1.51
buglist1.00 buglist2.00
KBCategory: kbtool kbfixlist kbbuglist
KBSubCategory: NmakeIss
Keywords : kbbuglist kbfixlist kbtool
Version : 1.50 1.51 | 1.00 2.00
Platform : NT WINDOWS
Solution Type : kbfix


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.

Last reviewed: September 18, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.