exempi-2.6.2 fails to build with musl
The attached patch (from Alpine Linux) is needed to be able to compile it with musl https://bugs.gentoo.org/884027
/bin/sh ../../libtool --tag=CXX --mode=compile x86_64-gentoo-linux-musl-g++ -DPACKAGE_NAME=\"exempi\" -DPACKAGE_TARNAME=\"exempi\" -DPACKAGE_VERSION=\"2.6.2\" -DPACKAGE_STRING=\"exempi\ 2.6.2\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"exempi\" -DVERSION=\"2.6.2\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_CXX11=1 -DCHECKED_ENDIANNESS=1 -DHAVE_ICONV=1 -DICONV_CONST= -DTLS=__thread -DHAVE_NATIVE_TLS=1 -I. -I../../public/include -I../.. -DUNIX_ENV=1 -D_FILE_OFFSET_BITS=64 -fexceptions -funsigned-char -fPIC -Wno-multichar -Wno-ctor-dtor-privacy -Os -march=znver3 -mtune=znver3 -pipe -fvisibility=hidden -Wchar-subscripts -Wcast-align -Wextra -Wexceptions -Wformat -Werror=class-memaccess -Wformat-security -Wlogical-not-parentheses -Werror=misleading-indentation -Wmissing-noreturn -Werror=missing-field-initializers -Woverloaded-virtual -Wpointer-arith -Wshadow -Wsign-compare -Wno-suggest-attribute=noreturn -Wunreachable-code -Wunused -Wwrite-strings -c -o common/DumpFile.lo common/DumpFile.cpp
libtool: compile: x86_64-gentoo-linux-musl-g++ -DPACKAGE_NAME=\"exempi\" -DPACKAGE_TARNAME=\"exempi\" -DPACKAGE_VERSION=\"2.6.2\" "-DPACKAGE_STRING=\"exempi 2.6.2\"" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"exempi\" -DVERSION=\"2.6.2\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_CXX11=1 -DCHECKED_ENDIANNESS=1 -DHAVE_ICONV=1 -DICONV_CONST= -DTLS=__thread -DHAVE_NATIVE_TLS=1 -I. -I../../public/include -I../.. -DUNIX_ENV=1 -D_FILE_OFFSET_BITS=64 -fexceptions -funsigned-char -fPIC -Wno-multichar -Wno-ctor-dtor-privacy -Os -march=znver3 -mtune=znver3 -pipe -fvisibility=hidden -Wchar-subscripts -Wcast-align -Wextra -Wexceptions -Wformat -Werror=class-memaccess -Wformat-security -Wlogical-not-parentheses -Werror=misleading-indentation -Wmissing-noreturn -Werror=missing-field-initializers -Woverloaded-virtual -Wpointer-arith -Wshadow -Wsign-compare -Wno-suggest-attribute=noreturn -Wunreachable-code -Wunused -Wwrite-strings -c common/DumpFile.cpp -fPIC -DPIC -o common/.libs/DumpFile.o
common/DumpFile.cpp: In function 'std::string convert8Bit(void*, bool, XMP_Uns32)':
common/DumpFile.cpp:57:22: warning: unused variable 'tmp' [-Wunused-variable]
57 | char tmp = ((char*)str)[byteLen - 1];
| ^~~
common/DumpFile.cpp: In function 'std::string convert16Bit(bool, XMP_Uns8*, bool, XMP_Uns32)':
common/DumpFile.cpp:109:22: warning: unused variable 'tmp' [-Wunused-variable]
109 | char tmp = str[byteLen - 1];
| ^~~
common/DumpFile.cpp: In function 'void DumpImageResources(const JpegMarkers&, XMP_Uns8*, const char*)':
common/DumpFile.cpp:1315:28: warning: unused variable 'psirOrigin' [-Wunused-variable]
1315 | XMP_Uns8 * psirOrigin = psirMarkers[i].jpegMarkerPtr;
| ^~~~~~~~~~
In file included from ../../samples/source/common/LargeFileAccess.hpp:27,
from ../../samples/source/common/TagTree.h:22,
from ../../samples/source/common/DumpFile.h:13,
from common/DumpFile.cpp:37:
common/DumpFile.cpp: In function 'void DumpISOBoxes(LFA_FileRef, XMP_Uns32, std::string)':
common/DumpFile.cpp:2479:56: error: cannot convert 'std::nullptr_t' to 'XMP_Uns16' {aka 'short unsigned int'} in assignment
2479 | exif_item_id = NULL;
| ^~~~
common/DumpFile.cpp:2472:51: warning: unused variable 'tiffLength1' [-Wunused-variable]
2472 | XMP_Uns64 tiffLength1 = (stoi(tree->getValue("meta/iloc/item[" + to_string(exif_item_id) + "]/extent_length")));
| ^~~~~~~~~~~
common/DumpFile.cpp:2497:56: error: cannot convert 'std::nullptr_t' to 'XMP_Uns16' {aka 'short unsigned int'} in assignment
2497 | mime_item_id = NULL;
| ^~~~
common/DumpFile.cpp:2532:43: warning: declaration of 'item_id' shadows a previous local [-Wshadow]
2532 | XMP_Uns32 item_id;
| ^~~~~~~
common/DumpFile.cpp:2352:35: note: shadowed declaration is here
2352 | XMP_Uns16 item_id;
| ^~~~~~~
common/DumpFile.cpp:2649:56: error: cannot convert 'std::nullptr_t' to 'XMP_Uns16' {aka 'short unsigned int'} in assignment
2649 | exif_item_id = NULL;
| ^~~~
common/DumpFile.cpp:2642:51: warning: unused variable 'tiffLength1' [-Wunused-variable]
2642 | XMP_Uns64 tiffLength1 = (stoi(tree->getValue("meta/iloc/item[" + to_string(exif_item_id) + "]/extent_length")));
| ^~~~~~~~~~~
common/DumpFile.cpp:2667:56: error: cannot convert 'std::nullptr_t' to 'XMP_Uns16' {aka 'short unsigned int'} in assignment
2667 | mime_item_id = NULL;
[...]
```[1.patch](/uploads/b55ffd8bd39617eba95d4393fd29234c/1.patch)
Edited by Francisco Ramos