I've recently bumped into lots of annoying messages about deprecated
conversion from string constant to 'char*' when I was using libunbound
with C++.
Apparently, functions in <unbound.h> can safely handle const char*
parameters, but they are declared and defined to take char*. This
represents no problem in C. But in C++ string literals are considered
const char*.
If there is no reason for declaring those functions with char* arguments
I would suggest to change the function prototypes to take const char*
arguments. The suggested patch is in the attachment.
Thanks for the patch. I wanted the initial header file to use the
least language constructs as these give rise to portability and
parsing issues (such as types, 'pid_t'). This is why all the numbers
are passed as 'int'. const seems to be 'C99' and posix
This sort of construct is very annoying to use, because a system
header file may be used by different compilers (e.g. clang, gcc,
suncc, icc ..) and different programs may use a different standards-level.
So, right now, I have committed 'const' and hope everyone supports it.