PRB: C1035: Expression Too Complex Error with C 6.0a/6.0ax

ID Number: Q72225

6.00a 6.00ax | 6.00a

MS-DOS | OS/2

buglist6.00a buglist6.00ax fixlist7.00

Summary:

SYMPTOMS

The Microsoft C Compiler versions 6.0a and 6.0ax generate the

following error when the sample program below is compiled with any

optimization except /Od, /Oe, /Og, /Ol, or /Ox:

fatal error C1035: expression too complex, please simplify

RESOLUTION

To eliminate this error, either of the following workarounds may

be used:

- Add the /Oe, /Ol, or /Og optimization to any optimization already

in use.

-or-

- Compile with the quick compile (/qc) option.

STATUS

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

and 6.0ax. This problem was corrected in C version 7.0.

More Information:

Sample Code

-----------

/* Compile options needed: none

*/

#include <stdio.h>

void create_rec(char *record)

{

int j = 0;

j = j+ sprintf(record+j, "%s", "string");

j = j+ sprintf(record+j, "%s", "string");

j = j+ sprintf(record+j, "%s", "string");

j = j+ sprintf(record+j, "%s", "string");

j = j+ sprintf(record+j, "%s", "string");

j = j+ sprintf(record+j, "%s", "string");

j = j+ sprintf(record+j, "%s", "string");

j = j+ sprintf(record+j, "%s", "string");

j = j+ sprintf(record+j, "%s", "string");

j = j+ sprintf(record+j, "%s", "string");

}

Additional reference words: 6.00 6.00a 6.00ax