divyang4481 / rcf-cpp

Automatically exported from code.google.com/p/rcf-cpp
0 stars 0 forks source link

Warning about using old headers #22

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile with gcc (g++) 4.3.3
2. See the following warning:

In file included from /usr/include/c++/4.3/backward/strstream:51,
                 from ../RCF-1.1/include/RCF/ByteBuffer.hpp:13,
                 from ../RCF-1.1/include/RCF/AsyncFilter.hpp:20,
                 from ../RCF-1.1/include/RCF/ClientStub.hpp:22,
                 from ../RCF-1.1/include/RCF/Idl.hpp:21,
                 from ScriptClient.cxx:5:
/usr/include/c++/4.3/backward/backward_warning.h:33:2: warning: #warning
This file includes at least one deprecated or antiquated header which may
be removed without further notice at a future date. Please use a
non-deprecated interface with equivalent functionality instead. For a
listing of replacement headers and interfaces, consult the file
backward_warning.h. To disable this warning use -Wno-deprecated.

What is the expected output? What do you see instead?
No warnings

What version of the product are you using? On what operating system?
RCF 1.1

Please provide any additional information below.

The header file (backward_warning.h) gives the following hits to resolving
those warnings:

  Use:                                  Instead of:
  <sstream>, basic_stringbuf            <strstream>, strstreambuf
  <sstream>, basic_istringstream        <strstream>, istrstream
  <sstream>, basic_ostringstream        <strstream>, ostrstream
  <sstream>, basic_stringstream         <strstream>, strstream
  <unordered_set>, unordered_set        <ext/hash_set>, hash_set
  <unordered_set>, unordered_multiset   <ext/hash_set>, hash_multiset
  <unordered_map>, unordered_map        <ext/hash_map>, hash_map
  <unordered_map>, unordered_multimap   <ext/hash_map>, hash_multimap
  <functional>, bind                    <functional>, binder1st
  <functional>, bind                    <functional>, binder2nd
  <functional>, bind                    <functional>, bind1st
  <functional>, bind                    <functional>, bind2nd
  <memory>, unique_ptr                  <memory>, auto_ptr

Original issue reported on code.google.com by marius.k...@gmail.com on 5 Aug 2009 at 11:49

GoogleCodeExporter commented 9 years ago

The warning is correct - RCF uses the istrstream/ostrstream classes, which are 
officially deprecated.

However, the functionality of these two classes is not provided by any other 
classes 
in the standard library (ability to read and write directly to memory buffers). 
ostringstream and istringstream are recommended, but their safety advantages 
come at 
a cost - they require their memory buffers to be copied, which is not 
acceptable for 
performance reasons.

Original comment by jarl.lin...@gmail.com on 6 Aug 2009 at 6:32

GoogleCodeExporter commented 9 years ago

Original comment by jarl.lin...@gmail.com on 14 Feb 2010 at 9:14