Opened 6 months ago

Closed 6 months ago

Last modified 6 months ago

#70063 closed defect (fixed)

yazproxy @1.3.10: error: ‘atoi’ was not declared in this scope

Reported by: barracuda156 Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.9.3
Keywords: haspatch Cc:
Port: yazproxy

Description

Looks like it is now broken by the new libxml2: I have 1.3.12 build but now it fails on the same system:

/bin/sh ../libtool  --tag=CXX   --mode=compile /usr/bin/g++-4.2 -DPACKAGE_NAME=\"yazproxy\" -DPACKAGE_TARNAME=\"yazproxy\" -DPACKAGE_VERSION=\"1.3.12\" -DPACKAGE_STRING=\"yazproxy\ 1.3.12\" -DPACKAGE_BUGREPORT=\"yaz-help@indexdata.dk\" -DPACKAGE_URL=\"\" -DPACKAGE=\"yazproxy\" -DVERSION=\"1.3.12\" -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_SETRLIMIT=1 -DHAVE_GETRLIMIT=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_SYS_RESOURCE_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIBDL=1 -I.   -I/opt/local/include -I./../include -I/opt/local/include -DYAZ_POSIX_THREADS=1 -DYAZ_HAVE_XML2=1 -DYAZ_HAVE_XSLT=1 -I/opt/local/include/libxml2 -I/opt/local/include -I/opt/local/include  -pipe -Os -arch ppc -MT modules.lo -MD -MP -MF .deps/modules.Tpo -c -o modules.lo modules.cpp
yaz-proxy-config.cpp: In member function ‘void Yaz_ProxyConfigP::get_period(xmlNode*, int*)’:
yaz-proxy-config.cpp:176: error: ‘atoi’ was not declared in this scope
yaz-proxy-config.cpp: In member function ‘void Yaz_ProxyConfigP::return_limit(xmlNode*, int*, int*, int*, int*)’:
yaz-proxy-config.cpp:195: error: ‘atoi’ was not declared in this scope
yaz-proxy-config.cpp:202: error: ‘atoi’ was not declared in this scope
yaz-proxy-config.cpp:209: error: ‘atoi’ was not declared in this scope
yaz-proxy-config.cpp:216: error: ‘atoi’ was not declared in this scope
yaz-proxy-config.cpp: In member function ‘void Yaz_ProxyConfigP::return_target_info(xmlNode*, const char**, int*, int*, int*, int*, int*, int*, int*, int*, int*, int*, const char**, const char**, const char**, const char**, const char**)’:
yaz-proxy-config.cpp:250: error: ‘atoi’ was not declared in this scope
yaz-proxy-config.cpp:281: error: ‘atoi’ was not declared in this scope
yaz-proxy-config.cpp:292: error: ‘atoi’ was not declared in this scope
yaz-proxy-config.cpp:303: error: ‘atoi’ was not declared in this scope
yaz-proxy-config.cpp: In member function ‘int Yaz_ProxyConfigP::check_type_1_attributes(odr*, xmlNode*, Z_AttributeList*, char**)’:
yaz-proxy-config.cpp:441: error: ‘atoi’ was not declared in this scope
yaz-proxy-config.cpp: In member function ‘int Yaz_ProxyConfig::check_syntax(odr*, const char*, Odr_oid*, Z_RecordComposition*, char**, char**, char**, char**, char**, char**, char**, char**)’:
yaz-proxy-config.cpp:911: error: ‘atoi’ was not declared in this scope
yaz-proxy-config.cpp: In member function ‘void Yaz_ProxyConfig::get_generic_info(int*, int*, int*, int*, int*, int*)’:
yaz-proxy-config.cpp:1100: error: ‘atoi’ was not declared in this scope
yaz-proxy-config.cpp:1114: error: ‘atoi’ was not declared in this scope
yaz-proxy-config.cpp:1124: error: ‘atoi’ was not declared in this scope
yaz-proxy-config.cpp:1132: error: ‘atoi’ was not declared in this scope
yaz-proxy-config.cpp:1141: error: ‘atoi’ was not declared in this scope
yaz-proxy-config.cpp:1162: error: ‘atoi’ was not declared in this scope
yaz-proxy-config.cpp: In member function ‘void Yaz_ProxyConfig::get_target_info(const char*, const char**, int*, int*, int*, int*, int*, int*, int*, int*, int*, int*, int*, const char**, const char**, const char**, const char**, const char**)’:
yaz-proxy-config.cpp:1353: error: ‘atoi’ was not declared in this scope
make[1]: *** [yaz-proxy-config.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
  1. S. The port is at 1.3.10, but likely broken just as much.

Change History (2)

comment:1 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)

Keywords: haspatch added
Owner: set to ryandesign
Status: newaccepted
Summary: yazproxy does not build with new libxml2 (?): error: ‘atoi’ was not declared in this scopeyazproxy @1.3.10: error: ‘atoi’ was not declared in this scope

Confirmed build failure with 1.3.10.

atoi is a standard C function; to use it, you must #include <stdlib.h> from C code or from C++ code you could instead include #include <cstdlib>. See #41855. Perhaps this used to work because an older version of libxml2 or other dependency used to include the stdlib header but now no longer does. But a program should directly include what it uses.

https://github.com/indexdata/yazproxy/pull/24

Last edited 6 months ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:2 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: acceptedclosed

In 9fbe23c1ed6b5e1a49ba3e6b256a83f83944a7bb/macports-ports (master):

yazproxy: Include <stdlib.h> for atoi

Closes: #70063

Note: See TracTickets for help on using tickets.