ygrek / mldonkey

cross-platform multi-network p2p daemon (previously at http://mldonkey.sourceforge.net/)
Other
253 stars 46 forks source link

Build fails with Apple clang on macOS 14: `error: ISO C++11 does not allow access declarations; use using declarations instead` #117

Open barracuda156 opened 1 month ago

barracuda156 commented 1 month ago
+ /usr/bin/clang -arch arm64 -O2 -fno-strict-aliasing -fwrapv -pthread  -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch arm64 -D_FILE_OFFSET_BITS=64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk   -c  -I /byterun -o src/networks/fasttrack/fst_crypt_ml.o -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch arm64     -pthread -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch arm64 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -pthread  -I'/opt/local/lib/ocaml' 'src/networks/fasttrack/fst_crypt_ml.c'
clang: warning: -Wl,-headerpad_max_install_names: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-L/opt/local/lib' [-Wunused-command-line-argument]
src/networks/fasttrack/fst_crypt_ml.c:50:9: warning: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
  char *s = String_val(s_v);
        ^   ~~~~~~~~~~~~~~~
src/networks/fasttrack/fst_crypt_ml.c:56:28: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
  fst_cipher_crypt(cipher, s+pos, len);
                           ^~~~~
src/networks/fasttrack/fst_crypt.h:54:58: note: passing argument to parameter 'data' here
void fst_cipher_crypt (FSTCipher *cipher, unsigned char *data, int len);
                                                         ^
src/networks/fasttrack/fst_crypt_ml.c:86:9: warning: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
  char *s = String_val(s_v);
        ^   ~~~~~~~~~~~~~~~
src/networks/fasttrack/fst_crypt_ml.c:140:9: warning: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
  char *s = String_val(s_v);
        ^   ~~~~~~~~~~~~~~~
src/networks/fasttrack/fst_crypt_ml.c:161:9: warning: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
  char *s = String_val(s_v);
        ^   ~~~~~~~~~~~~~~~
5 warnings generated.
ccache /usr/bin/clang++ -std=gnu++11 -pipe -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -arch arm64 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -o src/utils/lib/CryptoPP.o "-I/opt/local/lib/ocaml" -c src/utils/lib/CryptoPP.cc
In file included from src/utils/lib/CryptoPP.cc:85:
src/utils/lib/CryptoPP.h:3936:26: error: ISO C++11 does not allow access declarations; use using declarations instead
        BufferedTransformation::Get;
                                ^
        using 
src/utils/lib/CryptoPP.h:3937:26: error: ISO C++11 does not allow access declarations; use using declarations instead
        BufferedTransformation::Peek;
                                ^
        using 
src/utils/lib/CryptoPP.h:3938:26: error: ISO C++11 does not allow access declarations; use using declarations instead
        BufferedTransformation::TransferTo;
                                ^
        using 
src/utils/lib/CryptoPP.h:3939:26: error: ISO C++11 does not allow access declarations; use using declarations instead
        BufferedTransformation::CopyTo;
                                ^
        using 
src/utils/lib/CryptoPP.h:3940:26: error: ISO C++11 does not allow access declarations; use using declarations instead
        BufferedTransformation::CopyRangeTo;
                                ^
        using 
src/utils/lib/CryptoPP.h:3941:26: error: ISO C++11 does not allow access declarations; use using declarations instead
        BufferedTransformation::TransferMessagesTo;
                                ^
        using 
src/utils/lib/CryptoPP.h:3942:26: error: ISO C++11 does not allow access declarations; use using declarations instead
        BufferedTransformation::CopyMessagesTo;
                                ^
        using 
src/utils/lib/CryptoPP.h:3943:26: error: ISO C++11 does not allow access declarations; use using declarations instead
        BufferedTransformation::TransferAllTo;
                                ^
        using 
src/utils/lib/CryptoPP.h:3944:26: error: ISO C++11 does not allow access declarations; use using declarations instead
        BufferedTransformation::CopyAllTo;
                                ^
        using 
src/utils/lib/CryptoPP.cc:698:7: warning: 'auto_ptr<CryptoPP::PK_MessageAccumulator>' is deprecated [-Wdeprecated-declarations]
        std::auto_ptr<PK_MessageAccumulator> m(messageAccumulator);
             ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__memory/auto_ptr.h:30:28: note: 'auto_ptr<CryptoPP::PK_MessageAccumulator>' has been explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr
                           ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__config:1025:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#    define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__config:1010:49: note: expanded from macro '_LIBCPP_DEPRECATED'
#      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
                                                ^
src/utils/lib/CryptoPP.cc:704:7: warning: 'auto_ptr<CryptoPP::PK_MessageAccumulator>' is deprecated [-Wdeprecated-declarations]
        std::auto_ptr<PK_MessageAccumulator> m(NewSignatureAccumulator(rng));
             ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__memory/auto_ptr.h:30:28: note: 'auto_ptr<CryptoPP::PK_MessageAccumulator>' has been explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr
                           ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__config:1025:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#    define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__config:1010:49: note: expanded from macro '_LIBCPP_DEPRECATED'
#      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
                                                ^
src/utils/lib/CryptoPP.cc:712:7: warning: 'auto_ptr<CryptoPP::PK_MessageAccumulator>' is deprecated [-Wdeprecated-declarations]
        std::auto_ptr<PK_MessageAccumulator> m(NewSignatureAccumulator(rng));
             ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__memory/auto_ptr.h:30:28: note: 'auto_ptr<CryptoPP::PK_MessageAccumulator>' has been explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr
                           ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__config:1025:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#    define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__config:1010:49: note: expanded from macro '_LIBCPP_DEPRECATED'
#      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
                                                ^
src/utils/lib/CryptoPP.cc:720:7: warning: 'auto_ptr<CryptoPP::PK_MessageAccumulator>' is deprecated [-Wdeprecated-declarations]
        std::auto_ptr<PK_MessageAccumulator> m(messageAccumulator);
             ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__memory/auto_ptr.h:30:28: note: 'auto_ptr<CryptoPP::PK_MessageAccumulator>' has been explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr
                           ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__config:1025:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#    define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__config:1010:49: note: expanded from macro '_LIBCPP_DEPRECATED'
#      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
                                                ^
src/utils/lib/CryptoPP.cc:726:7: warning: 'auto_ptr<CryptoPP::PK_MessageAccumulator>' is deprecated [-Wdeprecated-declarations]
        std::auto_ptr<PK_MessageAccumulator> m(NewVerificationAccumulator());
             ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__memory/auto_ptr.h:30:28: note: 'auto_ptr<CryptoPP::PK_MessageAccumulator>' has been explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr
                           ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__config:1025:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#    define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__config:1010:49: note: expanded from macro '_LIBCPP_DEPRECATED'
#      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
                                                ^
src/utils/lib/CryptoPP.cc:734:7: warning: 'auto_ptr<CryptoPP::PK_MessageAccumulator>' is deprecated [-Wdeprecated-declarations]
        std::auto_ptr<PK_MessageAccumulator> m(messageAccumulator);
             ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__memory/auto_ptr.h:30:28: note: 'auto_ptr<CryptoPP::PK_MessageAccumulator>' has been explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr
                           ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__config:1025:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#    define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__config:1010:49: note: expanded from macro '_LIBCPP_DEPRECATED'
#      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
                                                ^
src/utils/lib/CryptoPP.cc:742:7: warning: 'auto_ptr<CryptoPP::PK_MessageAccumulator>' is deprecated [-Wdeprecated-declarations]
        std::auto_ptr<PK_MessageAccumulator> m(NewVerificationAccumulator());
             ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__memory/auto_ptr.h:30:28: note: 'auto_ptr<CryptoPP::PK_MessageAccumulator>' has been explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr
                           ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__config:1025:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#    define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__config:1010:49: note: expanded from macro '_LIBCPP_DEPRECATED'
#      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
                                                ^
src/utils/lib/CryptoPP.cc:1047:8: warning: 'auto_ptr<std::vector<unsigned short>>' is deprecated [-Wdeprecated-declarations]
                std::auto_ptr<std::vector<word16> > pPrimeTable(new std::vector<word16>);
                     ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__memory/auto_ptr.h:30:28: note: 'auto_ptr<std::vector<unsigned short>>' has been explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr
                           ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__config:1025:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#    define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__config:1010:49: note: expanded from macro '_LIBCPP_DEPRECATED'
#      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
                                                ^
src/utils/lib/CryptoPP.cc:6788:8: warning: 'auto_ptr<CryptoPP::OutputProxy>' is deprecated [-Wdeprecated-declarations]
                std::auto_ptr<OutputProxy> temp(proxy = new OutputProxy(*this, false));
                     ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__memory/auto_ptr.h:30:28: note: 'auto_ptr<CryptoPP::OutputProxy>' has been explicitly marked deprecated here
class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 auto_ptr
                           ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__config:1025:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#    define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/c++/v1/__config:1010:49: note: expanded from macro '_LIBCPP_DEPRECATED'
#      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
                                                ^
In file included from src/utils/lib/CryptoPP.cc:85:
src/utils/lib/CryptoPP.h:4285:74: warning: binding dereferenced null pointer to reference has undefined behavior [-Wnull-dereference]
                        R value = Hack_DefaultValueFromConstReferenceType(reinterpret_cast<R>(*(int *)NULL));
                                                                                              ^~~~~~~~~~~~
src/utils/lib/CryptoPP.cc:7847:3: note: in instantiation of function template specialization 'CryptoPP::AssignFromHelperClass<CryptoPP::RSAFunction, CryptoPP::RSAFunction>::operator()<const CryptoPP::Integer &>' requested here
                CRYPTOPP_SET_FUNCTION_ENTRY(Modulus)
                ^
src/utils/lib/CryptoPP.h:4441:44: note: expanded from macro 'CRYPTOPP_SET_FUNCTION_ENTRY'
#define CRYPTOPP_SET_FUNCTION_ENTRY(name)               (Name::name(), &ThisClass::Set##name)
                                                        ^
src/utils/lib/CryptoPP.h:4285:74: warning: binding dereferenced null pointer to reference has undefined behavior [-Wnull-dereference]
                        R value = Hack_DefaultValueFromConstReferenceType(reinterpret_cast<R>(*(int *)NULL));
                                                                                              ^~~~~~~~~~~~
src/utils/lib/CryptoPP.cc:8029:3: note: in instantiation of function template specialization 'CryptoPP::AssignFromHelperClass<CryptoPP::InvertibleRSAFunction, CryptoPP::RSAFunction>::operator()<const CryptoPP::Integer &>' requested here
                CRYPTOPP_SET_FUNCTION_ENTRY(Prime1)
                ^
src/utils/lib/CryptoPP.h:4441:44: note: expanded from macro 'CRYPTOPP_SET_FUNCTION_ENTRY'
#define CRYPTOPP_SET_FUNCTION_ENTRY(name)               (Name::name(), &ThisClass::Set##name)
                                                        ^
11 warnings and 9 errors generated.
make: *** [src/utils/lib/CryptoPP.o] Error 1
barracuda156 commented 1 month ago

Ok, so it build with this added:

configure.cxxflags-append \
                    -std=c++98

However, perhaps, better to fix it properly, since who knows when support for archaic C++ gets dropped from Apple compilers (and they may do that).

ygrek commented 1 month ago

same issue as with your previous reports - I have to guess missing information - i suspect this is not git master (which doesn't bundle cryptopp anymore to avoid exactly this issue)