home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / cplus / 18166 < prev    next >
Encoding:
Text File  |  1992-12-20  |  1.3 KB  |  36 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!world!btarbox
  3. From: btarbox@world.std.com (Brian J Tarbox)
  4. Subject: compiler error reporting
  5. Message-ID: <BzFq6w.MHB@world.std.com>
  6. Organization: The World Public Access UNIX, Brookline, MA
  7. Date: Fri, 18 Dec 1992 03:11:19 GMT
  8. Lines: 26
  9.  
  10. Why are c++ compilers so bad about reporting errors?
  11. Long ago most c compilers would unhelpfully say only
  12. "syntax error" to most errors.  They have progressed
  13. to now giving very help error messages.  Most c++
  14. compilers (especially on workstations) still give
  15. terrible errors.
  16.  
  17. For example, in a class I had the following private
  18. variable declared:  "Process process"  i.e. 'process'
  19. is a 'Process'.  I accidentally passed 'Process' to
  20. a routine and got 30 errors, none of which where
  21. within 10 lines of the incorrect line.
  22.  
  23. Second example.  I forward declare a class and then 
  24. try to call one of its public functions.  I get a
  25. 'no matching signature for member function bla' error.
  26. Having written a few compilers I KNOW the compiler knows
  27. it hasn't seen the real class definition, and it also
  28. KNOWS (in the previous example) that a class name is not
  29. allowed as a parameter.  While the latest esoteric features
  30. are nice, I'd sure like to see the 'feature' of decent
  31. error reporting.
  32.  
  33. Brian Tarbox
  34. Been There - Done That Software
  35.  
  36.