davidchisnall / dtc

FreeBSD Device Tree Compiler
19 stars 15 forks source link

fdt: Expect strchr() to return a const char*. #14

Closed rakuco closed 7 years ago

rakuco commented 7 years ago

In C, strchr(3) returns a char*, whereas C++ defines two overloads:

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.

emaste commented 7 years ago

LGTM. Would you commit it directly to FreeBSD-head too?