Opened 5 years ago

Last modified 2 years ago

#60014 closed defect

unalz @ 0.65: error: 'register' storage class specifier is deprecated ... — at Initial Version

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

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.

Change History (2)

Changed 5 years ago by Cor0n4V1rus

Attachment: unalz-main.log added

Changed 5 years ago by Cor0n4V1rus

Attachment: Portfile added

patched Portfile

Note: See TracTickets for help on using tickets.