[MacPorts] #60014: unalz @ 0.65: error: 'register' storage class specifier is deprecated ...

MacPorts noreply at macports.org
Thu Jan 30 21:04:25 UTC 2020


#60014: unalz @ 0.65: error: 'register' storage class specifier is deprecated ...
--------------------------+-----------------------
  Reporter:  Cor0n4V1rus  |      Owner:  minskim@…
      Type:  defect       |     Status:  assigned
  Priority:  Normal       |  Milestone:
 Component:  ports        |    Version:
Resolution:               |   Keywords:  haspatch
      Port:  unalz        |
--------------------------+-----------------------
Changes (by mf2k):

 * cc: minskim@… (removed)
 * status:  new => assigned
 * owner:  (none) => minskim@…


Old description:

> build fails with modern c++ compiler(s), clang-9 in this case:
>
> /opt/local/bin/clang++-mp-9.0  -Os -stdlib=libc++ -arch x86_64 -arch i386
> -c -o UnAlz.o UnAlz.cpp
> UnAlz.cpp:1910:23: error: cannot initialize a variable of type 'const
> unsigned long *' with an rvalue of type 'const z_crc_t *' (aka 'const
> unsigned int *')
>         const unsigned long *CRC_TABLE = get_crc_table();
>                              ^           ~~~~~~~~~~~~~~~
> UnAlz.cpp:1938:2: warning: 'register' storage class specifier is
> deprecated and incompatible with C++17 [-Wdeprecated-register]
>         register unsigned int i = 0;
>         ^~~~~~~~~
> UnAlz.cpp:1950:2: warning: 'register' storage class specifier is
> deprecated and incompatible with C++17 [-Wdeprecated-register]
>         register char *d = dest;
>         ^~~~~~~~~
> 2 warnings and 1 error generated.
> make: *** [UnAlz.o] Error 1
>

>
> the appended new Portfile also patches another build error:
>
> /opt/local/bin/clang++-mp-9.0  -Os -stdlib=libc++ -arch x86_64 -arch i386
> -c -o UnAlz.o UnAlz.cpp
> UnAlz.cpp:1910:23: error: cannot initialize a variable of type 'const
> unsigned long *' with an rvalue of type 'const z_crc_t *' (aka 'const
> unsigned int *')
>         const unsigned long *CRC_TABLE = get_crc_table();
>                              ^           ~~~~~~~~~~~~~~~
> 1 error generated.
> make: *** [UnAlz.o] Error 1
>

>
> since the source code files are not using unix newlines and I don't know
> how to handle them with the patch program directly and I'm too lazy to
> invoke tr, sed or another program to fix that first via the Portfile
> (which might help future patch-actions), I just added two new 'reinplace'
> instructions to the Portfile.

New description:

 build fails with modern c++ compiler(s), clang-9 in this case:
 {{{
 /opt/local/bin/clang++-mp-9.0  -Os -stdlib=libc++ -arch x86_64 -arch i386
 -c -o UnAlz.o UnAlz.cpp
 UnAlz.cpp:1910:23: error: cannot initialize a variable of type 'const
 unsigned long *' with an rvalue of type 'const z_crc_t *' (aka 'const
 unsigned int *')
         const unsigned long *CRC_TABLE = get_crc_table();
                              ^           ~~~~~~~~~~~~~~~
 UnAlz.cpp:1938:2: warning: 'register' storage class specifier is
 deprecated and incompatible with C++17 [-Wdeprecated-register]
         register unsigned int i = 0;
         ^~~~~~~~~
 UnAlz.cpp:1950:2: warning: 'register' storage class specifier is
 deprecated and incompatible with C++17 [-Wdeprecated-register]
         register char *d = dest;
         ^~~~~~~~~
 2 warnings and 1 error generated.
 make: *** [UnAlz.o] Error 1
 }}}


 the appended new Portfile also patches another build error:
 {{{
 /opt/local/bin/clang++-mp-9.0  -Os -stdlib=libc++ -arch x86_64 -arch i386
 -c -o UnAlz.o UnAlz.cpp
 UnAlz.cpp:1910:23: error: cannot initialize a variable of type 'const
 unsigned long *' with an rvalue of type 'const z_crc_t *' (aka 'const
 unsigned int *')
         const unsigned long *CRC_TABLE = get_crc_table();
                              ^           ~~~~~~~~~~~~~~~
 1 error generated.
 make: *** [UnAlz.o] Error 1
 }}}

 since the source code files are not using unix newlines and I don't know
 how to handle them with the patch program directly and I'm too lazy to
 invoke tr, sed or another program to fix that first via the Portfile
 (which might help future patch-actions), I just added two new 'reinplace'
 instructions to the Portfile.

--

-- 
Ticket URL: <https://trac.macports.org/ticket/60014#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list