Closed rakuco closed 7 years ago
In C, strchr(3) returns a char*, whereas C++ defines two overloads:
strchr(3)
char*
const char *strchr(const char*, int)
char *strchr(char*, int)
Building fdt.cc with libc++ 3.9.0 was failing because libc++ r260377 added the first overload to string.h, leading to failures such as:
fdt.cc:1638:8: error: cannot initialize a variable of type 'char *' with an rvalue of type 'const char *'
Just define val as a const char* to fix it.
val
const char*
LGTM. Would you commit it directly to FreeBSD-head too?
In C,
strchr(3)
returns achar*
, whereas C++ defines two overloads:const char *strchr(const char*, int)
char *strchr(char*, int)
Building fdt.cc with libc++ 3.9.0 was failing because libc++ r260377 added the first overload to string.h, leading to failures such as:
Just define
val
as aconst char*
to fix it.