home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!news.mentorg.com!sdl!adk
- From: adk@Warren.MENTORG.COM (Ajay Kamdar)
- Subject: Re: Destruction of temporaries
- Message-ID: <1992Sep1.154828.687@Warren.MENTORG.COM>
- Organization: Mentor Graphics Corp. - IC Group
- References: <rmartin.715101472@thor> <1992Aug31.162915.2577@Warren.MENTORG.COM> <rmartin.715356168@thor>
- Date: Tue, 1 Sep 1992 15:48:28 GMT
- Lines: 44
-
- In article <rmartin.715356168@thor> rmartin@thor.Rational.COM (Bob Martin) writes:
- >adk@Warren.MENTORG.COM (Ajay Kamdar) writes:
- >
-
- - example where implicit conversion of a temporary to char* is ok deleted -
-
- >|I wouldn't want the compiler to issue warnings in such a case, irrespective
- >|of whether operator char*() was called on a temporary or not.
- >
- >Then, you should cajole your compiler vender into supplying you with a
- >compiler which provides you with the type of #pragma control that lets
- >you supress the warnings on a function by function basis.
- >
- >
-
- Development teams do not necessarily use the same compiler on different
- platforms. pragmas are not necessarily portable across compilers, and hence
- could be a problem if a product has to be supported on multiple platforms.
-
- Are you advocating this generation of warnings as an optional "quality of
- implementation" feature of compliers, or as a language standard? If it
- is the former, it makes sense for the compiler to also provide means to
- turn off the warnings via pragmas or command line switches. It might be
- that you need to cajole your compiler vendor into supplying you with a
- compiler which provides these warnings.
-
- But if it is a language standard that you are advocating, then depending
- upon pragmas (which are implementation dependent by definition) to silence
- warnings from code which is perfectly ok seems inappropriate to me. If the
- standard specifies the generation of warnings, it had better make sure that
- it enables the compilers to generate warnings only for the problematic
- cases and not for good code.
-
- Warning about conversion of a temporary to pointer or reference is a nice
- goal to shoot for, but that needs the language to be enhanced to enable
- the compilers to do a good job of it.
-
- - Ajay
-
- --
- I speak for none but myself.
-
- Ajay Kamdar Email : ajay_kamdar@mentorg.com
- Mentor Graphics, IC Group (Warren, NJ) Phone : (908) 580-0102
-