PRB:C6.0 Fails to Generate Symbolic Info for ELSE IF Statement

ID Number: Q65744

6.00 6.00a 6.00ax | 6.00 6.00a

MS-DOS | OS/2

buglist6.00 buglist6.00a buglist6.00ax fixlist7.00

SYMPTOMS

The sample code below, when compiled with Microsoft C version 6.0,

6.0a, or 6.0ax for CodeView debugging (/Zi), does not stop at

breakpoints placed on the ELSE IF line of code. Also, any attempt

to step onto the line using the trace or step command will skip

over this line as if no executable code was associated with it.

RESOLUTION

The following are two possible workarounds to this problem:

- Compile with the /qc (quick compile) option, which generates the

correct symbolic information.

-or-

- Put the ELSE and IF on separate source lines, as follows:

ELSE

IF(i==7);

STATUS

Microsoft has confirmed this to be a problem in C versions 6.0,

6.0a, and 6.0ax. This problem was corrected in C/C++ version 7.0.

More Information:

As can be seen in CodeView by switching into mixed source/assembly

mode, there is executable code associated with the ELSE IF statement.

And, if a breakpoint is placed on one of the assembly instructions

associated with the ELSE IF line, execution will be able to stop on

that instruction demonstrating that the code is being executed.

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 reference words: 6.00 6.00a 6.00ax