Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

operator= is a private member of AString #358

Open
tansy opened this issue Nov 12, 2023 · 2 comments
Open

operator= is a private member of AString #358

tansy opened this issue Nov 12, 2023 · 2 comments

Comments

@tansy
Copy link

tansy commented Nov 12, 2023

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 <wchar.h>, <wctype.h>. Shall I add <ctype.h> or <wctype.h> 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
Copy link
Owner

mcmilk commented Feb 26, 2024

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

@tansy
Copy link
Author

tansy commented Mar 5, 2024

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-R3__CPP__7zip__UI__Common__Update.cpp.diff.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants