[Bug 271424] graphics/ufraw: fix build with clang 16

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 14 May 2023 18:49:44 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271424

            Bug ID: 271424
           Summary: graphics/ufraw: fix build with clang 16
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: rodrigo@FreeBSD.org
          Reporter: dim@FreeBSD.org
             Flags: maintainer-feedback?(rodrigo@FreeBSD.org)
          Assignee: rodrigo@FreeBSD.org

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.