[AGENT++] src/asn1.cpp:386:5: error: ISO C++17 does not allow 'register' storage class specifier

Claus Klein claus.klein at arcormail.de
Tue Aug 21 22:21:59 CEST 2018


Hi,

I have problems to compile snmp++ with newer clang++ compiler

Best regards
Claus

Making all in src
make[2]: Verzeichnis „/Users/clausklein/Downloads/snmp++-3.3.10/build/src“ wird betreten
/bin/sh ../libtool --tag=CXX   --mode=compile clang++ -DHAVE_CONFIG_H -I. -I../../src -I..  -I/Users/clausklein/Downloads/snmp++-3.3.10/build/../include -D_THREAD_SAFE   -DHAVE_LIBSSL -I/opt/local/include  --std=c++17 -Wpedantic -Wextra -Wall -D_THREAD_SAFE  -MT address.lo -MD -MP -MF .deps/address.Tpo -c -o address.lo ../../src/address.cpp
libtool: compile:  clang++ -DHAVE_CONFIG_H -I. -I../../src -I.. -I/Users/clausklein/Downloads/snmp++-3.3.10/build/../include -D_THREAD_SAFE -DHAVE_LIBSSL -I/opt/local/include --std=c++17 -Wpedantic -Wextra -Wall -D_THREAD_SAFE -MT address.lo -MD -MP -MF .deps/address.Tpo -c ../../src/address.cpp  -fno-common -DPIC -o .libs/address.o
libtool: compile:  clang++ -DHAVE_CONFIG_H -I. -I../../src -I.. -I/Users/clausklein/Downloads/snmp++-3.3.10/build/../include -D_THREAD_SAFE -DHAVE_LIBSSL -I/opt/local/include --std=c++17 -Wpedantic -Wextra -Wall -D_THREAD_SAFE -MT address.lo -MD -MP -MF .deps/address.Tpo -c ../../src/address.cpp -o address.o >/dev/null 2>&1
mv -f .deps/address.Tpo .deps/address.Plo
/bin/sh ../libtool --tag=CXX   --mode=compile clang++ -DHAVE_CONFIG_H -I. -I../../src -I..  -I/Users/clausklein/Downloads/snmp++-3.3.10/build/../include -D_THREAD_SAFE   -DHAVE_LIBSSL -I/opt/local/include  --std=c++17 -Wpedantic -Wextra -Wall -D_THREAD_SAFE  -MT asn1.lo -MD -MP -MF .deps/asn1.Tpo -c -o asn1.lo ../../src/asn1.cpp
libtool: compile:  clang++ -DHAVE_CONFIG_H -I. -I../../src -I.. -I/Users/clausklein/Downloads/snmp++-3.3.10/build/../include -D_THREAD_SAFE -DHAVE_LIBSSL -I/opt/local/include --std=c++17 -Wpedantic -Wextra -Wall -D_THREAD_SAFE -MT asn1.lo -MD -MP -MF .deps/asn1.Tpo -c ../../src/asn1.cpp  -fno-common -DPIC -o .libs/asn1.o
../../src/asn1.cpp:386:5: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    register int header_len;
    ^~~~~~~~~
1 error generated.
make[2]: *** [Makefile:471: asn1.lo] Fehler 1
make[2]: Verzeichnis „/Users/clausklein/Downloads/snmp++-3.3.10/build/src“ wird verlassen
make[1]: *** [Makefile:508: all-recursive] Fehler 1
make[1]: Verzeichnis „/Users/clausklein/Downloads/snmp++-3.3.10/build“ wird verlassen
make: *** [Makefile:393: all] Fehler 2
Claus-MBP:build clausklein$ clang++ --version
clang version 5.0.2 (tags/RELEASE_502/final)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /opt/local/libexec/llvm-5.0/bin


There are also cppcheck serious warnings:

src/auth_priv.cpp:2046:0: warning: Object pointed by an 'auto_ptr' is destroyed using operator 'delete'. You should not use 'auto_ptr' for pointers obtained with operator 'new[]'. [useAutoPointerArray]
    std::auto_ptr<unsigned char> ipad(new unsigned char[block_size]);
^
src/auth_priv.cpp:2047:0: warning: Object pointed by an 'auto_ptr' is destroyed using operator 'delete'. You should not use 'auto_ptr' for pointers obtained with operator 'new[]'. [useAutoPointerArray]
    std::auto_ptr<unsigned char> opad(new unsigned char[block_size]);
^

Checking src/md5c.cpp ...
src/log.cpp:344:0: warning: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [localtimeCalled]
    struct tm* stm = localtime(&t);
^
src/log.cpp:346:0: warning: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [localtimeCalled]
        strftime(buf, 18, "%Y%m%d.%H:%M:%S", localtime(&t));
^



More information about the AGENTPP mailing list