Opened 5 years ago

Closed 2 years ago

#60014 closed defect (fixed)

unalz @ 0.65: error: 'register' storage class specifier is deprecated ...

Reported by: Cor0n4V1rus Owned by: RobK88
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch Cc:
Port: unalz

Description (last modified by mf2k (Frank Schima))

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.

Attachments (2)

unalz-main.log (88.9 KB) - added by Cor0n4V1rus 5 years ago.
Portfile (1.6 KB) - added by Cor0n4V1rus 5 years ago.
patched Portfile

Download all attachments as: .zip

Change History (6)

Changed 5 years ago by Cor0n4V1rus

Attachment: unalz-main.log added

Changed 5 years ago by Cor0n4V1rus

Attachment: Portfile added

patched Portfile

comment:1 Changed 5 years ago by mf2k (Frank Schima)

Thanks. Per the guidelines, please instead attach a unified diff of the Portfile so we can easily see what changes you are proposing. Or better yet, submit a GitHub pull request.

In the future, please use WikiFormatting.

comment:2 Changed 5 years ago by mf2k (Frank Schima)

Cc: minskim@… removed
Description: modified (diff)
Owner: set to minskim@…
Status: newassigned

comment:3 Changed 5 years ago by mf2k (Frank Schima)

Owner: minskim@… deleted

See #60030

comment:4 Changed 2 years ago by RobK88

Owner: set to RobK88
Resolution: fixed
Status: assignedclosed

In 5080b0deda26a30fa23b7e84a567326a2fa4e4e7/macports-ports (master):

unalz: fix bugs and security flaws

  • Revive abandoned port
  • Fix Fails to Build From Source (FTBFS) on modern compilers
  • Use system zlib from Macports instead of the internal old version of zlib
  • Use system libbz2 from Macports instead of the internal old version of libbz2
  • Fix type error caused by introduction of z_crc_t type in zlib
  • Correct pipe mode. Don't do close() or utime() in pipe mode
  • Check to see if the filename length field is invalid
  • Fix file offset overflow on incomplete files
  • Add the license to the Portfile
  • Update the long description in the Portfile
  • Add two new library dependencies to the Portfile - zlib and bzip2
  • Update the developer's homepage in the Portfile
  • Remove unnecessary statements from the Portfile
  • Add revision number to the Portfile

Closes: #60014
Closes: #65561

Note: See TracTickets for help on using tickets.