Bug 271424 - graphics/ufraw: fix build with clang 16
Summary: graphics/ufraw: fix build with clang 16
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: Rodrigo Osorio
URL:
Keywords:
Depends on:
Blocks: 271047
  Show dependency treegraph
 
Reported: 2023-05-14 18:49 UTC by Dimitry Andric
Modified: 2023-05-18 11:44 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (rodrigo)


Attachments
graphics/ufraw: fix build with clang 16 (3.53 KB, patch)
2023-05-14 18:50 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 freebsd_triage 2023-05-14 18:49:44 UTC
graphics/ufraw: fix build with clang 16

Since clang 16 (and gcc 11) the default C++ standard is now gnu++17.
Because graphics/ufraw's configure scripts and Makefiles do not
explicitly set the C++ standard, this leads to several errors:

  /usr/local/include/lcms2.h:1291:44: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
  typedef cmsInt32Number (* cmsSAMPLER16)   (CMSREGISTER const cmsUInt16Number In[],
                                             ^~~~~~~~~~~~
  /usr/local/include/lcms2.h:158:23: note: expanded from macro 'CMSREGISTER'
  #  define CMSREGISTER register
                        ^
  /usr/local/include/lcms2.h:1292:44: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
                                             CMSREGISTER cmsUInt16Number Out[],
                                             ^~~~~~~~~~~~
  /usr/local/include/lcms2.h:158:23: note: expanded from macro 'CMSREGISTER'
  #  define CMSREGISTER register
                        ^
  /usr/local/include/lcms2.h:1293:44: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
                                             CMSREGISTER void * Cargo);
                                             ^~~~~~~~~~~~
  /usr/local/include/lcms2.h:158:23: note: expanded from macro 'CMSREGISTER'
  #  define CMSREGISTER register
                        ^
  /usr/local/include/lcms2.h:1295:44: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
  typedef cmsInt32Number (* cmsSAMPLERFLOAT)(CMSREGISTER const cmsFloat32Number In[],
                                             ^~~~~~~~~~~~
  /usr/local/include/lcms2.h:158:23: note: expanded from macro 'CMSREGISTER'
  #  define CMSREGISTER register
                        ^
  /usr/local/include/lcms2.h:1296:44: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
                                             CMSREGISTER cmsFloat32Number Out[],
                                             ^~~~~~~~~~~~
  /usr/local/include/lcms2.h:158:23: note: expanded from macro 'CMSREGISTER'
  #  define CMSREGISTER register
                        ^
  /usr/local/include/lcms2.h:1297:44: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
                                             CMSREGISTER void * Cargo);
                                             ^~~~~~~~~~~~
  /usr/local/include/lcms2.h:158:23: note: expanded from macro 'CMSREGISTER'
  #  define CMSREGISTER register
                        ^

Specifically for lcms2.h, adding -DCMS_NO_REGISTER_KEYWORD to CPPFLAGS
would be enough, but graphics/ufraw also pulls in exiv2 headers which
make use of std::auto_ptr, another construct that has been removed from
C++17.

Add USE_CXXSTD=gnu++98 to compile for C++98 with GNU extensions instead.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-05-14 18:50:19 UTC
Created attachment 242174 [details]
graphics/ufraw: fix build with clang 16
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-05-18 11:42:01 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3792a424426e3174db35a7fff23815baa25d3b8c

commit 3792a424426e3174db35a7fff23815baa25d3b8c
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-05-14 18:45:20 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-05-18 11:39:45 +0000

    graphics/ufraw: fix build with clang 16

    Since clang 16 (and gcc 11) the default C++ standard is now gnu++17.
    Because graphics/ufraw's configure scripts and Makefiles do not
    explicitly set the C++ standard, this leads to several errors:

      /usr/local/include/lcms2.h:1291:44: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
      typedef cmsInt32Number (* cmsSAMPLER16)   (CMSREGISTER const cmsUInt16Number In[],
                                                 ^~~~~~~~~~~~
      /usr/local/include/lcms2.h:158:23: note: expanded from macro 'CMSREGISTER'
      #  define CMSREGISTER register
                            ^
      /usr/local/include/lcms2.h:1292:44: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
                                                 CMSREGISTER cmsUInt16Number Out[],
                                                 ^~~~~~~~~~~~
      /usr/local/include/lcms2.h:158:23: note: expanded from macro 'CMSREGISTER'
      #  define CMSREGISTER register
                            ^
      /usr/local/include/lcms2.h:1293:44: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
                                                 CMSREGISTER void * Cargo);
                                                 ^~~~~~~~~~~~
      /usr/local/include/lcms2.h:158:23: note: expanded from macro 'CMSREGISTER'
      #  define CMSREGISTER register
                            ^
      /usr/local/include/lcms2.h:1295:44: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
      typedef cmsInt32Number (* cmsSAMPLERFLOAT)(CMSREGISTER const cmsFloat32Number In[],
                                                 ^~~~~~~~~~~~
      /usr/local/include/lcms2.h:158:23: note: expanded from macro 'CMSREGISTER'
      #  define CMSREGISTER register
                            ^
      /usr/local/include/lcms2.h:1296:44: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
                                                 CMSREGISTER cmsFloat32Number Out[],
                                                 ^~~~~~~~~~~~
      /usr/local/include/lcms2.h:158:23: note: expanded from macro 'CMSREGISTER'
      #  define CMSREGISTER register
                            ^
      /usr/local/include/lcms2.h:1297:44: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
                                                 CMSREGISTER void * Cargo);
                                                 ^~~~~~~~~~~~
      /usr/local/include/lcms2.h:158:23: note: expanded from macro 'CMSREGISTER'
      #  define CMSREGISTER register
                            ^

    Specifically for lcms2.h, adding -DCMS_NO_REGISTER_KEYWORD to CPPFLAGS
    would be enough, but graphics/ufraw also pulls in exiv2 headers which
    make use of std::auto_ptr, another construct that has been removed from
    C++17.

    Add USE_CXXSTD=gnu++98 to compile for C++98 with GNU extensions instead.

    PR:             271424
    Approved by:    portmgr (build fix blanket)
    MFH:            2023Q2

 graphics/ufraw/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)