I'm working on GCC119 from the compile farm. The machine is AIX 7.1, POWER8 with IBM XLC 13.1. I'm trying to use the debug heap:
gcc119$ cat test.cxx
#include <altivec.h>
#undef vector
#undef pixel
#undef bool
#include <cstdlib>
int main(int argc, char* argv[])
{
unsigned char x[32];
std::memset(x, 0x00, 32);
return 0;
}
A compile results in:
gcc119$ xlC -DDEBUG -g3 -O0 -qheapdebug -qro test.cxx -o test.exe
"test.cxx", line 11.3: 1540-0130 (S) "std::_debug_memset" is not declared.
Both <cstring>
and <string.h>
result in the error. I also tried including <cstdlib>
and <stdlib.h>
, and they resulted in the same error.
The Optimization and Programming Guide manual has a good discussion of debugging memory functions, but the treatment is C only. It does not appear to treat C++.
How does one use debug heaps in a C++ program?
gcc119$ oslevel -s
7200-00-01-1543
gcc119$ xlC -qversion
IBM XL C/C++ for AIX, V13.1.3 (5725-C72, 5765-J07)
Version: 13.01.0003.0004
You should try including
<string.h>
instead and using unqualifiedmemset
. According to the IBM XL C/C++ Programming Guide,_debug_memset
lives instring.h
. So the question becomes, shouldn't<cstring>
make it available viastd::
? In the IBM XL C/C++ Standard Library reference, it shows all of the using declarations, and the debug functions are not there.