Bug 75287 - <ostream> vs <ostream.h>
Summary: <ostream> vs <ostream.h>
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 8.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-10-06 20:37 UTC by han.holl
Modified: 2007-04-18 16:47 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-10-06 20:37:33 UTC
Embargoed:


Attachments (Terms of Use)

Description han.holl 2002-10-06 20:37:27 UTC
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 17.4.1.2 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:
Always

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

Actual Results:  See above

Expected Results:  Should compile ?

Additional info:

None

Comment 1 Jakub Jelinek 2002-10-06 20:42:02 UTC
The compiler is right, your program is not ISO C++.
#include <ostream>
std::ostream& operator<< (std::ostream&, int);
is.
Or you could add
using namespace std;
or
using std::ostream;
after your includes.

Comment 2 han.holl 2002-10-06 21:21:50 UTC
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.