Bug 75287

Summary: <ostream> vs <ostream.h>
Product: [Retired] Red Hat Linux Reporter: han.holl
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-10-06 20:37:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.