diff options
author | Raphael Kubo da Costa <rakuco@FreeBSD.org> | 2016-11-26 12:36:11 +0000 |
---|---|---|
committer | Raphael Kubo da Costa <rakuco@FreeBSD.org> | 2016-11-26 12:36:11 +0000 |
commit | be5d5a33e6622e3680ff927eaa425f2fd1c6cfba (patch) | |
tree | db814417f23b36ac690e7a6f220df6e0a7e4983f /usr.bin/dtc | |
parent | def44246f2d3b3398814badb0dcacb5825556a2e (diff) | |
download | src-test-be5d5a33e6622e3680ff927eaa425f2fd1c6cfba.tar.gz src-test-be5d5a33e6622e3680ff927eaa425f2fd1c6cfba.zip |
fdt: Expect strchr() to return a const char*
In C, strchr(3) returns a char*, whereas C++ defines two overloads:
* const char *strchr(const char*, int)
* char *strchr(char*, int)
Building fdt.cc (with the WITHOUT_GPL_DTC knob set) with libc++ 3.9.0 (imported
in r309124) 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.
Upstreamed in https://github.com/davidchisnall/dtc/pull/14
Reviewed by: emaste
Approved by: emaste
Notes
Notes:
svn path=/head/; revision=309191
Diffstat (limited to 'usr.bin/dtc')
-rw-r--r-- | usr.bin/dtc/fdt.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/dtc/fdt.cc b/usr.bin/dtc/fdt.cc index 41c627d3fd909..16ebfd1fa3ddb 100644 --- a/usr.bin/dtc/fdt.cc +++ b/usr.bin/dtc/fdt.cc @@ -1635,7 +1635,7 @@ device_tree::parse_dts(const string &fn, FILE *depfile) bool device_tree::parse_define(const char *def) { - char *val = strchr(def, '='); + const char *val = strchr(def, '='); if (!val) { if (strlen(def) != 0) |