avoid mkstemps
jeroen opened this issue · 2 comments
jeroen commented
The mkstemps()
function is non-standard and not portable. You either need to test for it in autoconf and provide a fallback, or better: avoid it by using the POSIX.1-2001 standard mkstemp
.
CONFORMING TO top
mkstemp(): 4.3BSD, POSIX.1-2001.
mkstemps(): unstandardized, but appears on several other systems.
g -O2 -MT libdap_la-util.lo -MD -MP -MF .deps/libdap_la-util.Tpo -c -o libdap_la-util.lo `test -f 'util.cc' || echo '../libdap-3.19.0/'`util.cc
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../libdap-3.19.0 -I./gl -I../libdap-3.19.0/gl -I../libdap-3.19.0/GNU -IC:/msys64/mingw64/include/libxml2 -Wall -W -Wcast-align -g -O2 -MT libdap_la-util.lo -MD -MP -MF .deps/libdap_la-util.Tpo -c ../libdap-3.19.0/util.cc -DDLL_EXPORT -DPIC -o .libs/libdap_la-util.o
../libdap-3.19.0/util.cc: In function 'std::__cxx11::string libdap::open_temp_fstream(std::ofstream&, const string&, const string&)':
../libdap-3.19.0/util.cc:1224:19: error: 'mkstemps' was not declared in this scope
int tmpfile = mkstemps(&name[0], suffix.length());
jgallagher59701 commented
See https://opendap.atlassian.net/browse/HYRAX-458
Short version: I think we can remove use of mkstemps() because it's not really used by the code.
jgallagher59701 commented
I added gnulib's mkstemps() which includes a check in configure.