Issue 789 - Invalid mix of <iostream> & <iostream.h>
Summary: Invalid mix of <iostream> & <iostream.h>
Status: CLOSED FIXED
Alias: None
Product: Build Tools
Classification: Code
Component: code (show other issues)
Version: 633
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: nikolai.pretzell
QA Contact: issues@www
URL:
Keywords: oooqa
Depends on: 785 1096
Blocks: 790
  Show dependency tree
 
Reported: 2001-04-26 07:48 UTC by zeroj
Modified: 2013-08-07 15:35 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
xml2cmp/source/xcd/cr_html.hxx : Patch to use <iostream> & co (1.05 KB, patch)
2001-04-26 08:02 UTC, zeroj
no flags Details | Diff
xml2cmp/source/xcd/filebuff.cxx : Patch to use <iostream> & co (709 bytes, patch)
2001-04-26 08:03 UTC, zeroj
no flags Details | Diff
xml2cmp/source/xcd/cr_html.hxx : Patch to use <iostream> & co (OO627B) (1.04 KB, patch)
2001-04-28 05:59 UTC, zeroj
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description zeroj 2001-04-26 07:48:52 UTC
The new xml2cmp code has numerous problem, being that 'using std::cerr' is 
valid syntax with <iostream>, but not with <iostream.h> , as <iostream.h> does 
not/should not use namespaces.  Worse than that, xml2cmp code uses BOTH, 
resulting in two different STL implementations being included, and  hence cerr 
is not the same as std::cerr .  

I have created patches for this problem, choosing <iostream> and friends over 
their .h counterparts, as the syntax used thoughtout the code would only have 
worked with <iostream>.

CC -KPIC -c -n32 -ansi -ptused -OPT:Olimit=20523 -I. -I. -I../inc -I../../inc -
I../../unx/inc -I../../unxirxm3.pro/inc -I. -
I/projects/sise/mozilla/devel/workpits/oo/OO625B_MIPSpro/workarea/sal/inc -
I/projects/sise/mozilla/devel/workpits/oo/OO625B_MIPSpro
cc-1101 CC: ERROR File 
= /projects/sise/mozilla/devel/workpits/oo/OO625B_MIPSpro/workarea/xml2cmp/sourc
e/xcd/cr_html.cxx, Line = 67
  "cerr" has already been declared in the current scope.

  using std::cerr;
             ^

cc-1101 CC: ERROR File 
= /projects/sise/mozilla/devel/workpits/oo/OO625B_MIPSpro/workarea/xml2cmp/sourc
e/xcd/cr_html.cxx, Line = 68
  "ofstream" has already been declared in the current scope.

  using std::ofstream;
             ^

cc-1408 CC: ERROR File 
= /projects/sise/mozilla/devel/workpits/oo/OO625B_MIPSpro/workarea/xml2cmp/sourc
e/xcd/cr_html.cxx, Line = 241
  A reference of type "std::ofstream &" (not const-qualified) cannot be
          initialized with a value of type "ofstream".

        WriteName( aFile, sIdl_BaseDirectory, i_sStatus, lt_nolink );
                   ^

cc-1408 CC: ERROR File 
= /projects/sise/mozilla/devel/workpits/oo/OO625B_MIPSpro/workarea/xml2cmp/sourc
e/xcd/cr_html.cxx, Line = 337
  A reference of type "std::ofstream &" (not const-qualified) cannot be
          initialized with a value of type "ofstream".

        WriteName( aFile, sIdl_BaseDirectory, i_rElement.Data(), i_eLinkType );
                   ^

cc-1408 CC: ERROR File 
= /projects/sise/mozilla/devel/workpits/oo/OO625B_MIPSpro/workarea/xml2cmp/sourc
e/xcd/cr_html.cxx, Line = 349
  A reference of type "std::ofstream &" (not const-qualified) cannot be
          initialized with a value of type "ofstream".

                        WriteName( aFile, sIdl_BaseDirectory, i_rElement.Data
(i), i_eLinkType );
                                   ^

5 errors detected in the compilation 
of "/projects/sise/mozilla/devel/workpits/oo/OO625B_MIPSpro/workarea/xml2cmp/sou
rce/xcd/cr_html.cxx".
dmake:  Error code 2, while making '../../unxirxm3.pro/obj/cr_html.obj'
---* TG_SLO.MK *---
dmake:  Error code 255, while making 'xcd'
---* TG_SLO.MK *---
dmake:  Error code 255, while making 'source'
---* TG_SLO.MK *---

% find xml2cmp -name '*xx' | xargs grep 'include <.*stream[^x]*>'
xml2cmp/source/xcd/filebuff.cxx:#include <fstream.h>
xml2cmp/source/xcd/cr_metho.cxx:#include <fstream>
xml2cmp/source/xcd/cr_metho.cxx:#include <iostream>
xml2cmp/source/xcd/parse.cxx:#include <iostream>
xml2cmp/source/xcd/cr_index.cxx:#include <fstream>
xml2cmp/source/xcd/cr_html.cxx:#include <fstream>
xml2cmp/source/xcd/cr_html.hxx:#include <fstream.h>
xml2cmp/source/xcd/main.cxx:#include <iostream>
xml2cmp/source/support/heap.cxx:#include <iostream>
xml2cmp/source/support/list.hxx:#include <iostream>
xml2cmp/source/support/cmdline.cxx:#include <iostream>
xml2cmp/source/support/syshelp.hxx:#include <fstream>
xml2cmp/source/finder/dependy.cxx:#include <iostream>
xml2cmp/source/finder/dep_main.cxx:#include <iostream>

The offenders are cr_html.cxx & filebuff.cxx.
Comment 1 zeroj 2001-04-26 08:02:21 UTC
Created attachment 162 [details]
xml2cmp/source/xcd/cr_html.hxx : Patch to use <iostream> & co
Comment 2 zeroj 2001-04-26 08:03:31 UTC
Created attachment 163 [details]
xml2cmp/source/xcd/filebuff.cxx : Patch to use <iostream> & co
Comment 3 sander_traveling 2001-04-26 12:48:10 UTC
Accepting issue.
Comment 4 Unknown 2001-04-26 15:00:08 UTC
reassign
Comment 5 zeroj 2001-04-28 05:59:39 UTC
Created attachment 218 [details]
xml2cmp/source/xcd/cr_html.hxx : Patch to use <iostream> & co   (OO627B)
Comment 6 sander_traveling 2001-05-04 13:26:43 UTC
Patches applied in revisions 1.4.2.1 of both files, will merge to trunk aftre
verification on other platforms.
Comment 7 zeroj 2001-05-08 12:54:41 UTC
xml2cmp now compiles out of the tree except for a ansi-for-init-scope patch.  
Very happy.
Comment 8 zeroj 2001-06-07 06:31:48 UTC
It seems like this problem is visible again in OO632B
Comment 9 stx123 2001-06-07 11:11:55 UTC
Please reopen, if applicable
Comment 10 issues@www 2001-07-16 00:25:20 UTC
Still seeing issue in 633.
Comment 11 Martin Hollmichel 2001-07-26 14:36:09 UTC
Nikolai, can you please take these ?
Comment 12 nikolai.pretzell 2001-08-23 11:08:05 UTC
Thanks to John. I will check in your patches.
Comment 13 nikolai.pretzell 2001-10-02 09:53:45 UTC
Changes to always use STL-headers are committed , now.
Comment 14 ace_dent 2008-05-17 21:30:10 UTC
The Issue you raised has been marked as 'Resolved' and not updated within the
last 1 year+. I am therefore setting this issue to 'Verified' as the first step
towards Closing it. If you feel this is incorrect, please re-open the issue and
add any comments.

Many thanks,
Andrew
 
Cleaning-up and Closing old Issues
~ The Grand Bug Squash, pre v3 ~
http://marketing.openoffice.org/3.0/announcementbeta.html
Comment 15 ace_dent 2008-05-17 23:33:25 UTC
As per previous posting: Verified -> Closed.
A Closed Issue is a Happy Issue (TM).

Regards,
Andrew