home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 14 Text / 14-Text.zip / C6_BUGS.ZIP / C6_20065.BUG < prev    next >
Text File  |  1990-09-11  |  2KB  |  71 lines

  1. Q61312 Internal Compiler Error: '@(#)regMD.c:1.100', Line 3074
  2. Microsoft C Compiler (C)
  3. 6.00   | 6.00
  4. MS-DOS | OS/2
  5.  
  6. Summary:
  7.  
  8. The program example below generates the following C1001: error when
  9. compiled with only the following individual optimizations:
  10.  
  11.    /Oa /Oc /Oi /On /Op /Or /Os /Ot /Ow /Oz
  12.  
  13.    foo.c(24) : fatal error C1001: Internal Compiler Error
  14.          (compiler file '@(#)regMD.c:1.100', line 3074)
  15.          Contact Microsoft Product Support Services
  16.  
  17. Code Example
  18. ------------
  19.  
  20. typedef struct
  21. {
  22.    short cursize;      /* The current size of this buffer. */
  23.    short nextscan;     /* The offset of the next scan entry.*/
  24. } struct1;
  25.  
  26. typedef struct
  27. {
  28.    short len;          /* Buffer entry length */
  29. } struct2;
  30.  
  31. void main(void)
  32. {
  33.    char far *cfptr1;
  34.    char far *cfptr2;
  35.    struct1 far *s1ptr;
  36.    struct2 far *s2ptr;
  37.    short    lenToMove;
  38.  
  39.    s1ptr = (struct1 far *) cfptr1;
  40.    cfptr2 = (char far *) s2ptr + s2ptr->len;
  41.    lenToMove = s1ptr->cursize - (short)((long)cfptr2 - (long)cfptr1);
  42.  
  43.    if ((cfptr1 + s1ptr->nextscan) >= cfptr2) // Line 24
  44.    s1ptr->nextscan -= s2ptr->len;
  45. }
  46.  
  47. More Information:
  48.  
  49. If only the above optimizations are used to compile the program, the
  50. internal compiler error (ICE) will occur. However, if ONE option from
  51. the following list is added, the ICE will not occur:
  52.  
  53.  /Od /Oe /Og /Ol /Ox
  54.  
  55. In addition, the following are several other workarounds that can be
  56. applied to the code itself:
  57.  
  58. 1. Use temporary variables to hold the intermediate results before the
  59.    "if" statement.
  60.  
  61. 2. Make a function call between any of the assignment statements.
  62.  
  63. Microsoft has confirmed this to be a problem with C version 6.00. We
  64. are researching this problem and will post new information here as it
  65. becomes available.
  66.  
  67. Keywords:  buglist6.00
  68.  
  69. COPYRIGHT Microsoft Corporation, 1990.
  70. Updated  90/07/12 05:22
  71.