Apache OpenOffice (AOO) Bugzilla – Issue 31648
C++: Forte 6 Update 2 problem in connectivity/source/drivers/file/FStatement.cxx
Last modified: 2010-11-10 17:38:12 UTC
Hi, this is for C++ expert ;-) I'm doing build QA on 20040704 with Forte C++ 6 Update 2 on Solaris/SPARC. oo@ultra:/ultra/BuildDir/ooo_cws_src680_ooo20040704_src/connectivity/source/drivers/file> dmake --- EXCEPTIONSFILES --- ------------------------------ Making: ../../../unxsols4.pro/slo/FStatement.obj CC -c -temp=/tmp -I. -I. -I../inc -I../../inc -I../../../inc -I../../../unx/inc -I../../../unxsols4.pro/inc -I. -I/ultra/BuildDir/ooo_cws_src680_ooo20040704_src/solver/680/unxsols4.pro/inc/stl -I/ultra/BuildDir/ooo_cws_src680_ooo20040704_src/solver/680/unxsols4.pro/inc/external -I/ultra/BuildDir/ooo_cws_src680_ooo20040704_src/solver/680/unxsols4.pro/inc -I/ultra/BuildDir/ooo_cws_src680_ooo20040704_src/solenv/unxsols4/inc -I/ultra/BuildDir/ooo_cws_src680_ooo20040704_src/solenv/inc -I/ultra/BuildDir/ooo_cws_src680_ooo20040704_src/res -I/ultra/BuildDir/ooo_cws_src680_ooo20040704_src/solver/680/unxsols4.pro/inc/stl/SC5 -I/include -I/ultra/BuildDir/ooo_cws_src680_ooo20040704_src/solenv/inc/Xp31 -I/usr/java/include -I/usr/java/include/solaris -I/usr/java/include/native_threads/include -I. -I../../../res -I. -xarch=v8 -xO3 -xspace -features=no%altspell -library=no%Cstd -instances=static -KPIC -mt -DSOLARIS -DUNX -DVCL -DC52 -DC52 -DSPARC -DCVER=C52 -D_USE_NAMESPACE -D_PTHREADS -DSYSV -DSUN -DSUN4 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DSTLPORT_VERSION=400 -D__DMAKE -DUNIX -DCPPU_ENV=sunpro5 -DSUPD=680 -DPRODUCT -DNDEBUG -DPRODUCT_FULL -DOSL_DEBUG_LEVEL=0 -DOPTIMIZE -DEXCEPTIONS_ON -DCUI -DSOLAR_JAVA -DSRC680 -DSHAREDLIB -D_DLL_ -DMULTITHREAD -o ../../../unxsols4.pro/slo/FStatement.o /ultra/BuildDir/ooo_cws_src680_ooo20040704_src/connectivity/source/drivers/file/FStatement.cxx "/ultra/BuildDir/ooo_cws_src680_ooo20040704_src/solver/680/unxsols4.pro/inc/comphelper/propertycontainer.hxx", line 130: Warning: comphelper::OPropertyContainer::getFastPropertyValue hides the virtual function cppu::OPropertySetHelper::getFastPropertyValue(long). "/ultra/BuildDir/ooo_cws_src680_ooo20040704_src/connectivity/source/drivers/file/FStatement.cxx", line 627: Error: Could not find a match for _STL::vector<String, _STL::allocator<String>>::insert(String*, const rtl::OUString*, const rtl::OUString*). 1 Error(s) and 1 Warning(s) detected. dmake: Error code 1, while making '../../../unxsols4.pro/slo/FStatement.obj' '---* TG_SLO.MK *---' dmake: Error code 255, while making 'do_it_exceptions' '---* TG_SLO.MK *---' The attached patch fixes this problem for me/my compiler. Please decide.
Created attachment 16550 [details] Small patch
set target
Frank, can you please have a closer look ?
Pavel, I don't think this is a good idea. The line in question already was in the form you're suggesting, in revision 1.31. You're working on 1.31.28.1 (if I am correct), which touched exactly this one line which causes you trouble. We shouldn't change this back, as Caolans change was resonable. I am unsure about how to fix this (the original form should do), perhaps something like: copy( pBegin, pEnd, ::std::back_insert_iterator< ::std::vector< String > >( aColumnNameList ) ); If your compiler also doesn't accept this .... hmm. struct ConvertStringAndInsert : public ::std::unary_function< ::rtl::OUString, String > { private: back_insert_iterator< ::std::vector< String > > m_aInserter; public: ConvertStringAndInsert( back_insert_iterator< ::std::vector< String > > _rInserter ) : m_aInserter( _rInserter ) { } String operator()( const ::rtl::OUString& _rToConvert ) { // implicit conversion to String, and insertion *m_aInserter = rToConvert; // use *m_aInserter = String( rToConvert ); if the implicit conversion // does not work. } }; ::std::for_each( pBegin, pEnd, back_insert_iterator< ::std::vector< String > >( aColumnNameList ) ); And no, I did *not* actually test whether this complies, but will do if required :)
> struct ConvertStringAndInsert : public ::std::unary_function< ::rtl::OUString, String > > ... > String operator()( const ::rtl::OUString& _rToConvert ) replace "String" with "void" here .... > ::std::for_each( pBegin, pEnd, back_insert_iterator< ::std::vector< String > > >( aColumnNameList ) ); Place a "ConvertStringAndInsert( " before "back_", and add the missing bracket at the end .... Oh, and the trivial and boring solution :) would be something like while ( pBegin != pEnd ) aColumnNameList.push_back( String( *pBegin++ ) );
fs: I'd be glad if you could test it, because I'm in the middle of build (which means ~4 days cycle) on my slow Ultra. I looked back at 1.1.2 where I compiled successfully. Of course we can always tell that this is bug in the compiler and deprecate it ;-)
Created attachment 16584 [details] patch no. 1, using ::std::for_each
Created attachment 16585 [details] patch no. 1, using ::std::copy
Created attachment 16586 [details] patch no. 1, using while
No. 1 is the most STL-ish one, and should compile everywhere. No. 3 is without STL, and should compile everywhere. No. 2 is the most elegant one IMO :), but may not compile everywhere. All three patches compile on wntmsci8, going to verify unxlngi5.
All three patches also compile on unxlngi5, so take whatever your compiler accepts (my personal ranking would probably be 2, 3, 1) > Of course we can always tell that this is bug in the compiler and deprecate it > ;-) Nah - isn't it that "the compiler is always right!"? :)
Pavel, can you please check which patch works for you, and close this bug (if at least one does :), or reassign back to me?
OK, My build compelted so here are the sesults of tests. All done on 20040704 code just before closing. My compiler: oo@ultra:/ultra/BuildDir/ooo_cws_src680_ooo20040704_src/connectivity/source/drivers/file> CC -V CC: Sun WorkShop 6 update 2 C++ 5.3 Patch 111685-10 2002/09/16 oo@ultra:/ultra/BuildDir/ooo_cws_src680_ooo20040704_src/connectivity/source/drivers/file> I tried all patches and all compiles without problem. So can we implement at least one of them to CVS? Lowering prio, fixes (4 of them!) are known.
Since the "bug" was introduced with revision 1.31.28.1, on branch cws_src680_ooo20040704, I suggest we also fix it on this branch. Do you have checkin permissions, Pavel? Is this branch still open?
It is closed unfortunately :-(
Looking into EIS, it seems there is no successor in place, yet. So I suggest waiting until it *is*, and then checking in. (I have no other bug fixing CWS at hand at the moment, else I'd suggest to put it in *somewhere* ....)
Ok, I will commit patch nr. 2 (this was your highest rank ;-) to the next cws opened. Thanks!
It is fixed now by rewriting the source code (in SRC680_m55).
.
Created attachment 73542