Bug 244402 - textproc/libstaroffice: Fix build with clang 10.0.0
Summary: textproc/libstaroffice: Fix build with clang 10.0.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-office (Nobody)
URL:
Keywords:
Depends on:
Blocks: 244251
  Show dependency treegraph
 
Reported: 2020-02-25 17:55 UTC by Dimitry Andric
Modified: 2020-03-12 09:02 UTC (History)
1 user (show)

See Also:
lwhsu: maintainer-feedback+


Attachments
Fix several -Werror warnings in libstaroffice (3.75 KB, patch)
2020-02-25 17:55 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer 2020-02-25 17:55:25 UTC
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.
Comment 1 Li-Wen Hsu freebsd_committer 2020-02-28 12:16:13 UTC
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
Comment 2 Li-Wen Hsu freebsd_committer 2020-02-29 15:18:06 UTC
(In reply to Dimitry Andric from comment #0)
This seems doesn't apply cleanly. I'll check this. (Or build with 6.4.x)
Comment 3 Dimitry Andric freebsd_committer 2020-03-01 13:07:01 UTC
(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?
Comment 4 Li-Wen Hsu freebsd_committer 2020-03-01 13:33:55 UTC
(In reply to Dimitry Andric from comment #3)
Oh sorry that I overlooked this. I thought it was editors/libreoffice. :-(
Comment 5 Li-Wen Hsu freebsd_committer 2020-03-01 13:41:39 UTC
The patch looks good to me.
Comment 6 commit-hook freebsd_committer 2020-03-12 08:43:45 UTC
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
Comment 7 Li-Wen Hsu freebsd_committer 2020-03-12 09:01:56 UTC
Submitted to upstream at https://github.com/fosnola/libstaroffice/pull/8