Bug 75287 - <ostream> vs <ostream.h>
<ostream> vs <ostream.h>
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2002-10-06 16:37 EDT by han.holl
Modified: 2007-04-18 12:47 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-10-06 16:37:33 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description han.holl 2002-10-06 16:37:27 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2b) Gecko/20021002

Description of problem:
The following file compiles:
#include <ostream.h>

ostream& operator<< (ostream&, int);

but gives the warning:
In file included from /usr/include/c++/3.2/backward/ostream.h:31,
                 from try.C:1:
/usr/include/c++/3.2/backward/backward_warning.h:32:2: warning: #warning This
file includes at least one deprecated or antiquated header. Please consider
using one of the 32 headers found in section of the C++ standard.
Examples include substituting the <X> header for the <X.h> header for C++
includes, or <sstream> instead of the deprecated header <strstream.h>. To
disable this warning use -Wno-deprecated.

If I change <ostream.h> to <ostream> however, I get:
try.C:3: syntax error before `&' token

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.c++ -c file.C  with above files

Actual Results:  See above

Expected Results:  Should compile ?

Additional info:

Comment 1 Jakub Jelinek 2002-10-06 16:42:02 EDT
The compiler is right, your program is not ISO C++.
#include <ostream>
std::ostream& operator<< (std::ostream&, int);
Or you could add
using namespace std;
using std::ostream;
after your includes.
Comment 2 han.holl 2002-10-06 17:21:50 EDT
Wow, that was quick. Thanks.
I see now that converting my entire tree to new style headers
is going to involve more than just a few streamedits.

Note You need to log in before you can comment on or make changes to this bug.