Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 30951 - gcc-3.3.1-r4 c++ backward compatibility header file strstream.h is missing
Summary: gcc-3.3.1-r4 c++ backward compatibility header file strstream.h is missing
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Please assign to toolchain
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-11 23:29 UTC by Lars S. Jensen
Modified: 2003-10-25 23:46 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars S. Jensen 2003-10-11 23:29:48 UTC
The strstream.h has the wrong name: 'strstream'
ll /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/include/g++-v3/backward/
...
-rw-r--r--    1 root     root         1545 2003-10-12 02:10 stream.h
-rw-r--r--    1 root     root         5671 2003-10-12 02:10 strstream
-rw-r--r--    1 root     root         3023 2003-10-12 02:10 tempbuf.h
...

Please rename it to strstream.h


Reproducible: Always
Steps to Reproduce:




Portage 2.0.49-r7 (default-x86-1.4, gcc-3.3.1, glibc-2.2.5-r4,2.3.2-r1,
2.4.20-gentoo-r1-2)
Comment 1 James Harlow (RETIRED) gentoo-dev 2003-10-12 01:10:26 UTC
This is correct behaviour, it's there to correct "#include <strstream>".
Comment 2 Joshua Kinard gentoo-dev 2003-10-23 00:24:38 UTC
As per Comment #1, this is apparently correct behaviour on gcc's part.  I
can confirm this is the same in gcc-3.3.2.  If it is a bug, then this would
need to be filed with the GCC people directly.  Resolving as INVALID.
Comment 3 Lars S. Jensen 2003-10-23 10:51:44 UTC
There is no strstream(.h) in C++ only <sstream>

This is a bug because the GCC warning cause by this include file say:
" ...<sstream> instead of the deprecated header <strstream.h>..."

Take a look at gcc-3.2.3 and before that -- From my GCC-3.2.3-r
  
-rw-r--r--    1 root     root         5671 2003-10-12 09:35 strstream
-rw-r--r--    1 root     root         1573 2003-10-12 09:35 strstream.h
-rw-r--r--    1 root     root         3023 2003-10-12 09:35 tempbuf.h

And the code of part of strstream.h

#ifndef _CPP_BACKWARD_STRSTREAM_H
#define _CPP_BACKWARD_STRSTREAM_H 1
 
#include "strstream"
 
using std::strstreambuf;
using std::istrstream;
using std::ostrstream;
using std::strstream;
 
#endif

Please add the missing strstream.h from gcc3.2.3 line.
Comment 4 Lars S. Jensen 2003-10-23 10:56:37 UTC
This breaks a lot of old C++ code.  
Comment 5 James Harlow (RETIRED) gentoo-dev 2003-10-23 11:36:36 UTC
It only breaks code that isn't ISO C++, and g++ is an ISO C++ compiler. I
don't see how this is anything other than expected behaviour?
Comment 6 Lars S. Jensen 2003-10-23 12:09:34 UTC
Then please removed the include/g++-v3/backward files so that we are forced
to use ISO C++ :-)

But not all (old) C++ compiler support ISO C++ that is why we need the backward
compatibility header files because pre-ISO C++ code can be compile by almost
all C++ compiler.
Comment 7 Joshua Kinard gentoo-dev 2003-10-23 17:24:58 UTC
I really don't think this is something we in Gentoo can effectively deal
with.  Since just about every new gcc exhibits this behavior, that would
be alot of patching to simply support "old" c++ code.  If you feel strongly
about this, I highly advise filing a bug of this nature on GCC's bugzilla
and attempt to get it worked out upstream with the GCC people.

Package developers need to get up to spec honestly.  GCC is emerging as one
of the most widely used compilers out there, so packages still using deprecated
headers are likely going to fail.  Also including the strstream.h file from
gcc-3.2.3 into gcc-3.3.x is guaranteed to break things.  Much has changed
between those two branches, and we are even looking at gcc-3.4 on the horizon
in a few months.
Comment 8 Lars S. Jensen 2003-10-24 11:30:25 UTC
I found a bug 9925 in GCC about strstream(.h) where I added the information.

I have also added it as bug in GCC: 
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12766

I will report back when/if it is fixed in GCC.

I was testing gcc-3.4 with profiledbootstrap :-) (GCC CVS) when I found that
the file was missing.
Comment 9 Lars S. Jensen 2003-10-25 08:16:14 UTC
It was rejected by GCC becuase in it not strict ISO C++.

But in the gentoo linux HOWTO: /usr/share/doc/HOWTO/text/C++Programming-HOWTO.gz
[ebuild   R   ] app-doc/howto-text-20031006

It say use strstream.h. 
----------------------------- section 9.5 ---------------------
9.5.  Forget C

....Instead of this:
 
  #include <iostream.h>
  #include <stdio.h>
  /* . . . */
  char myaString[100];
  sprintf(myaString, "%s, %s %c", myaLname, myaFname, *myaMname);
  cout << myaString << '\n';

  Try This:       

  #include <iostream.h>
  #include <strstream.h>
  /* . . . */
  ostrstream ost;
  ost << myaLname << ", " << myaFname << " " << *myaMname;
  ost.put(0); //null terminate the string cout
  cout << ost.str() << '\n';
----
Comment 10 James Harlow (RETIRED) gentoo-dev 2003-10-25 10:11:49 UTC
Then the howto is broken, and should be fixed. :-)

(In fact it's been "removed for review".)
Comment 11 Joshua Kinard gentoo-dev 2003-10-25 23:46:06 UTC
Okay, since the GCC people even rejected the change, I'm going to close this
bug out.

This is just a necessary change in the continued evolution of GCC.  If you
come across any packages in gentoo that references the older strstream.h
file, please file a bug and assign it to gcc-porting.  It's why this team
exists.  It's better to change the packages themselves, rather than attempt
to re-introduce deprecated behaviour back into gcc, which is bound to be
a nightmare to even consider attempting.