home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / cplus / 13150 < prev    next >
Encoding:
Text File  |  1992-09-01  |  2.3 KB  |  55 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!news.mentorg.com!sdl!adk
  3. From: adk@Warren.MENTORG.COM (Ajay Kamdar)
  4. Subject: Re: Destruction of temporaries
  5. Message-ID: <1992Sep1.154828.687@Warren.MENTORG.COM>
  6. Organization: Mentor Graphics Corp. - IC Group
  7. References: <rmartin.715101472@thor> <1992Aug31.162915.2577@Warren.MENTORG.COM> <rmartin.715356168@thor>
  8. Date: Tue, 1 Sep 1992 15:48:28 GMT
  9. Lines: 44
  10.  
  11. In article <rmartin.715356168@thor> rmartin@thor.Rational.COM (Bob Martin) writes:
  12. >adk@Warren.MENTORG.COM (Ajay Kamdar) writes:
  13. >
  14.  
  15.   - example where implicit conversion of a temporary to char* is ok deleted -
  16.  
  17. >|I wouldn't want the compiler to issue warnings in such a case, irrespective
  18. >|of whether operator char*() was called on a temporary or not.
  19. >
  20. >Then, you should cajole your compiler vender into supplying you with a
  21. >compiler which provides you with the type of #pragma control that lets
  22. >you supress the warnings on a function by function basis.
  23. >
  24. >
  25.  
  26. Development teams do not necessarily use the same compiler on different
  27. platforms. pragmas are not necessarily portable across compilers, and hence
  28. could be a problem if a product has to be supported on multiple platforms.
  29.  
  30. Are you advocating this generation of warnings as an optional "quality of
  31. implementation" feature of compliers, or as a language standard? If it
  32. is the former, it makes sense for the compiler to also provide means to
  33. turn off the warnings via pragmas or command line switches. It might be
  34. that you need to cajole your compiler vendor into supplying you with a
  35. compiler which provides these warnings.
  36.  
  37. But if it is a language standard that you are advocating, then depending
  38. upon pragmas (which are implementation dependent by definition) to silence
  39. warnings from code which is perfectly ok seems inappropriate to me. If the
  40. standard specifies the generation of warnings, it had better make sure that
  41. it enables the compilers to generate warnings only for the problematic
  42. cases and not for good code.
  43.  
  44. Warning about conversion of a temporary to pointer or reference is a nice
  45. goal to shoot for, but that needs the language to be enhanced to enable
  46. the compilers to do a good job of it. 
  47.  
  48. - Ajay
  49.  
  50. -- 
  51. I speak for none but myself.
  52.  
  53. Ajay Kamdar                               Email : ajay_kamdar@mentorg.com
  54. Mentor Graphics, IC Group (Warren, NJ)    Phone : (908) 580-0102
  55.