mcmilk / 7-Zip-zstd

7-Zip with support for Brotli, Fast-LZMA2, Lizard, LZ4, LZ5 and Zstandard
https://mcmilk.de/projects/7-Zip-zstd/
Other
4.87k stars 291 forks source link

operator= is a private member of AString #358

Open tansy opened 7 months ago

tansy commented 7 months ago

Trying to compile last relaease (R3) with gcc on Linux I stumbled on error in `UI/Common/Update.cpp':

/mnt/dev1/src/7-Zip-zstd-22.01-v1.5.5-R3/CPP/7zip/Bundles/Alone2 # g++ -O2 -c -Wall -Wextra -Wno-reserved-id-macro -Wno-old-style-cast -Wno-c++11-long-long -Wno-unused-macros -Wno-extra-semi -Wno-sign-conversion -Wno-language-extension-token -Wno-global-constructors -Wno-non-virtual-dtor -Wno-switch-enum -Wno-covered-switch-default -Wno-cast-qual -Wno-padded -Wno-exit-time-destructors -Wno-weak-vtables  -Wno-reserved-id-macro -Wno-old-style-cast -Wno-c++11-long-long -Wno-unused-macros  -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC   -o g/c/Update.o  ../../UI/Common/Update.cpp
../../UI/Common/Update.cpp: In function ‘LONG Compress(const CUpdateOptions&, bool, CCodecs*, const NUpdateArchive::CActionSet&, const CArc*, CArchivePath&, const CObjectVector<CArcItem>&, Byte*, const CDirItems&, const CDirItem*, CTempFiles&, CUpdateErrorInfo&, IUpdateCallbackUI*, CFinishArchiveStat&)’:
../../UI/Common/Update.cpp:900:65: error: ‘AString& AString::operator=(const wchar_t*)’ is private within this context
         updateCallbackSpec->VolName = archivePath.Prefix + name.bstrVal;
                                                                 ^~~~~~~
In file included from ../../UI/Common/../../../Common/Wildcard.h:6:0,
                 from ../../UI/Common/Update.h:6,
                 from ../../UI/Common/Update.cpp:7:
../../UI/Common/../../../Common/MyString.h:244:8: note: declared private here
   cls &operator=(const t *); \

Similarily with clang:

/mnt/dev1/src/7-Zip-zstd-22.01-v1.5.5-R3/CPP/7zip/Bundles/Alone2 # clang++ -O2 -c -Wall -Wextra -Wno-reserved-id-macro -Wno-old-style-cast -Wno-c++11-long-long -Wno-unused-macros  -Weverything -Wno-extra-semi -Wno-sign-conversion -Wno-language-extension-token -Wno-global-constructors -Wno-non-virtual-dtor -Wno-switch-enum -Wno-covered-switch-default -Wno-cast-qual -Wno-padded -Wno-exit-time-destructors -Wno-weak-vtables  -Wno-reserved-id-macro -Wno-old-style-cast -Wno-c++11-long-long -Wno-unused-macros  -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC   -o b/c/Update.o  ../../UI/Common/Update.cpp
../../UI/Common/Update.cpp:900:37: error: 'operator=' is a private member of 'AString'
        updateCallbackSpec->VolName = archivePath.Prefix + name.bstrVal;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../UI/Common/../../Common/../../Common/MyString.h:292:3: note: implicitly declared private here
  FORBID_STRING_OPS_AString(wchar_t)

They didn't seem to be Linux specific so I report them. Ed. After later examination it seems to be somewhat Linux related as mingw-gcc, also v8, does manage to compile that, with some warnings regarding fallthrough in lines 64, 74.

There were other, like min/max undefined and isblank() undefined but I managed them. The first, on a list did not. And there is a question here, as it complains about lack of `isblank' which stems from lack of , . Shall I add or as it's available in include?

C++ is not my forte.

All errors are attached to the post.

7-Zip-zstd-22.01-v1.5.5-R3-err-1.tar.gz

mcmilk commented 4 months ago

I have no idea on that also ... How does Igor get it's linux binaries build? Maybe you can ask him?

tansy commented 3 months ago

It's 7-Zip-zstd specific, so I ask here.

In the diff attached line 900 is marked with `///', within section between L884-L914 that is added. 7-Zip-zstd-tags-v22.01-v1.5.5-R3CPP7zipUICommon__Update.cpp.diff.gz