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

  1. Q65358 C 6.00 Incorrectly Evaluates Pointer Arrays to Constant Data
  2. Microsoft C Compiler (C)
  3. 6.00   | 6.00
  4. MS-DOS | OS/2
  5.  
  6. Summary:
  7.  
  8. When an array of pointers to constant data is declared, the C version
  9. 6.00 and QuickC versions 2.50 and 2.51 compilers incorrectly consider
  10. both pointers and data to be constant.
  11.  
  12. The following sample code demonstrates the problem:
  13.  
  14. void main(void)
  15. {
  16.  const int *p[1];
  17.  const int Z = 0;
  18.  
  19.  p[0] = &Z;
  20. }
  21.  
  22. More Information:
  23.  
  24. When the sample code is compiled, the following two errors are
  25. produced:
  26.  
  27.    warning C4132: 'p': const object should be initialized
  28.  
  29.    error C2166: lvalue specifies const object
  30.  
  31. Only the data should be constant in this case. The compiler considers
  32. the pointers to be constant, which is in error, and does not allow
  33. their value to be changed.
  34.  
  35. Microsoft has confirmed this to be a problem with the Microsoft C
  36. Compiler version 6.00. We are researching this problem and will post
  37. new information here as it becomes available.
  38.  
  39. Keywords:  s_quickc buglist6.00
  40.  
  41. COPYRIGHT Microsoft Corporation, 1990.
  42. Updated  90/09/01 08:26
  43.