Microsoft KB Archive/117384

From BetaArchive Wiki

PSS ID Number: 117384

Article Last Modified on 10/16/2002



The information in this article applies to:

  • Microsoft C/C++ Compiler (CL.EXE), when used with:
    • Microsoft C/C++ for MS-DOS
    • Microsoft Visual C++ for Windows, 16-bit edition 1.0
    • Microsoft Visual C++ for Windows, 16-bit edition 1.5
    • Microsoft Visual C++, 32-bit Editions 1.0
    • Microsoft Visual C++, 32-bit Editions 2.0
    • Microsoft Visual C++, 32-bit Editions 2.1
    • Microsoft Visual C++, 32-bit Editions 4.0
    • Microsoft Visual C++, 32-bit Editions 4.1
    • Microsoft Visual C++, 32-bit Editions 4.2
    • Microsoft Visual C++, 32-bit Editions 5.0
    • Microsoft Visual C++, 32-bit Editions 6.0
    • Microsoft Visual C++ .NET (2002)



This article was previously published under Q117384

SYMPTOMS

If the sample code in the "MORE INFORMATION" section, below, is compiled for debugging (/Zi), the debugger (either CodeView or the Visual Workbench) does not stop at a breakpoint that is placed on the ELSE IF statement.

CAUSE

The compiler does not generate the correct symbolic information for the line of code containing the ELSE IF statement.

RESOLUTION

To work around the problem, place the "else" and "if" statements on separate lines. For example:

else
   if (i==7)
                

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

To reproduce this problem with the sample code below:

  1. Set a breakpoint on the line with the ELSE IF statement
  2. Press F5 (GO) to start debugging the program.

Neither debugger stops running until the program is finished, unless you set a breakpoint on a different line of code.

In CodeView, if you switch into mixed source/assembly mode, you can verify that there is executable code associated with the ELSE IF statement. If a breakpoint is placed on one of the lines of assembly code for the ELSE IF statement and the application is debugged, the code stops running at the breakpoint. With the Visual Workbench debugger, step through the code at the ELSE IF statement to set the breakpoint.

Sample Code

/* Compile options needed: /Zi /Od
*/ 

   void main(void)
   {
      int i=100;
      if (i==2);
      else if(i==7);  /* cannot stop on this line */ 
   }

                


Additional query words: kbVC400bug 6.00 8.00 8.00c 9.00 10.00 10.10 10.20

Keywords: kbBug kbCompiler KB117384
Technology: kbAudDeveloper kbCVCComp kbvc100 kbvc150 kbVC16bitSearch kbVC200 kbVC210 kbVC32bitSearch kbVC400 kbVC410 kbVC420 kbVC500 kbVC500Search kbVC600 kbVCNET kbVCsearch kbZNotKeyword3 kbZNotKeyword8