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

  1. Q61308 /Fs Does Not Locate Error When #line Directive Is Specified
  2. Microsoft C Compiler (C)
  3. 5.10 6.00 | 5.10 6.00
  4. MS-DOS    | OS/2
  5.  
  6. Summary:
  7.  
  8. When the #line preprocessor directive is used with a filename label,
  9. /Fs generates a source listing with the correct error count but fails
  10. to correctly locate the errors in the listing file.
  11.  
  12. Sample Code
  13. -----------
  14.  
  15. #include <stdio.h>
  16. #line 1 "hello"
  17.  
  18. void main()
  19. {
  20.    intt x; /* the error is here */
  21.  
  22.    printf("hello");
  23. }
  24.  
  25. More Information:
  26.  
  27. Below is the normal source listing generated by the compiler:
  28.  
  29.  Line#    Source Line          Microsoft C Compiler Version 6.00
  30.  
  31.       1
  32.       2 #include <stdio.h>
  33.       3
  34.       4 void main()
  35.       5 {
  36.       6    intt x; /* the error is here */
  37. ***** test.c(6) : error C2065: 'intt' : undefined
  38. ***** test.c(6) : error C2146: syntax error : missing ';' before ...
  39. ***** test.c(6) : error C2065: 'x' : undefined
  40.       7
  41.       8    printf("hello");
  42.       9 }
  43.  
  44. 3 errors detected
  45.  
  46. When compiled with a #line directive and a filename label, the source
  47. listing fails to indicate the error, only the number of errors. For
  48. example:
  49.  
  50.  Line#    Source Line          Microsoft C Compiler Version 6.00
  51.  
  52.       1 #include <stdio.h>
  53.       2
  54.       3 #line 1 "foobar"
  55.       4
  56.       5 void main()
  57.       6 {
  58.       7
  59.       8 intt x; /* error is here */
  60.       9
  61.      10    printf("hello");
  62.      11 }
  63.  
  64. 3 errors detected
  65.  
  66. If the filename label ("foobar" in this case) is not specified, the
  67. source listing contains the error messages, but they are not in the
  68. correct place. For example:
  69.  
  70.  Line#    Source Line          Microsoft C Compiler Version 6.00
  71.  
  72.       1
  73.       2 #include <stdio.h>
  74.       3 #line 1
  75.       4
  76. ***** test.c(4) : error C2065: 'intt' : undefined
  77. ***** test.c(4) : error C2146: syntax error : missing ';' before ...
  78. ***** test.c(4) : error C2065: 'x' : undefined
  79.       5 void main()
  80.       6 {
  81.       7    intt x; /* the error is here */
  82.       8
  83.       9    printf("hello");
  84.      10 }
  85.  
  86. 3 errors detected
  87.  
  88. Microsoft has confirmed this to be a problem with C version 6.00. We
  89. are researching this problem and will post new information here as it
  90. becomes available.
  91.  
  92. Keywords:  buglist6.00
  93.  
  94. COPYRIGHT Microsoft Corporation, 1990.
  95. Updated  90/07/12 05:22
  96.