Created attachment 211933 [details] Fix several -Werror warnings in libstaroffice As reported in bug 244251, with clang 10.0.0 the textproc/libstaroffice port runs into several -Werror warnings: In file included from SDCParser.cxx:43: ./STOFFSpreadsheetListener.hxx:70:31: error: class with destructor marked 'final' cannot be inherited from [-Werror,-Wfinal-dtor-non-final-class] ~STOFFSpreadsheetListener() final; ^ ./STOFFSpreadsheetListener.hxx:64:7: note: mark 'STOFFSpreadsheetListener' as 'final' to silence this warning class STOFFSpreadsheetListener : public STOFFListener ^ STOFFOLEParser.cxx:509:19: error: loop variable 'posToType' of type 'const std::__1::pair<const long, int>' creates a copy from type 'const std::__1::pair<const long, int>' [-Werror,-Wrange-loop-construct] for (auto const posToType : posToTypeMap) { ^ STOFFOLEParser.cxx:509:8: note: use reference type 'const std::__1::pair<const long, int> &' to prevent copying for (auto const posToType : posToTypeMap) { ^~~~~~~~~~~~~~~~~~~~~~ & StarObjectSmallGraphic.cxx:1392:21: error: loop variable 'poly' of type 'const StarGraphicStruct::StarPolygon' creates a copy from type 'const StarGraphicStruct::StarPolygon' [-Werror,-Wrange-loop-construct] for (auto const poly : m_pathPolygons) ^ StarObjectSmallGraphic.cxx:1392:10: note: use reference type 'const StarGraphicStruct::StarPolygon &' to prevent copying for (auto const poly : m_pathPolygons) ^~~~~~~~~~~~~~~~~ & StarObjectSmallGraphic.cxx:1415:20: error: class with destructor marked 'final' cannot be inherited from [-Werror,-Wfinal-dtor-non-final-class] ~SdrGraphicUno() final; ^ StarObjectSmallGraphic.cxx:1405:7: note: mark 'StarObjectSmallGraphicInternal::SdrGraphicUno' as 'final' to silence this warning class SdrGraphicUno : public SdrGraphicRect ^ These are all pretty trivial to fix, patch is attached.
I'm checking this one. In the mean time, could you help also checking this on 6.4? https://github.com/lwhsu/freebsd-ports-libreoffice
(In reply to Dimitry Andric from comment #0) This seems doesn't apply cleanly. I'll check this. (Or build with 6.4.x)
(In reply to Li-Wen Hsu from comment #2) What did you mean exactly, the patch doesn't apply cleanly to the latest textproc/libstaroffice port, or to the 6.4 update you appparently have in progress?
(In reply to Dimitry Andric from comment #3) Oh sorry that I overlooked this. I thought it was editors/libreoffice. :-(
The patch looks good to me.
A commit references this bug: Author: lwhsu Date: Thu Mar 12 08:43:00 UTC 2020 New revision: 528276 URL: https://svnweb.freebsd.org/changeset/ports/528276 Log: Fix build with clang 10.0.0 PR: 244402 Submitted by: dim Changes: head/textproc/libstaroffice/files/ head/textproc/libstaroffice/files/patch-src_lib_STOFFOLEParser.cxx head/textproc/libstaroffice/files/patch-src_lib_STOFFSpreadsheetListener.hxx head/textproc/libstaroffice/files/patch-src_lib_StarObjectSmallGraphic.cxx
Submitted to upstream at https://github.com/fosnola/libstaroffice/pull/8