Apache OpenOffice (AOO) Bugzilla – Issue 789
Invalid mix of <iostream> & <iostream.h>
Last modified: 2013-08-07 15:35:05 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.
Created attachment 162 [details] xml2cmp/source/xcd/cr_html.hxx : Patch to use <iostream> & co
Created attachment 163 [details] xml2cmp/source/xcd/filebuff.cxx : Patch to use <iostream> & co
Accepting issue.
reassign
Created attachment 218 [details] xml2cmp/source/xcd/cr_html.hxx : Patch to use <iostream> & co (OO627B)
Patches applied in revisions 1.4.2.1 of both files, will merge to trunk aftre verification on other platforms.
xml2cmp now compiles out of the tree except for a ansi-for-init-scope patch. Very happy.
It seems like this problem is visible again in OO632B
Please reopen, if applicable
Still seeing issue in 633.
Nikolai, can you please take these ?
Thanks to John. I will check in your patches.
Changes to always use STL-headers are committed , now.
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
As per previous posting: Verified -> Closed. A Closed Issue is a Happy Issue (TM). Regards, Andrew