Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Nov 26, 2016

Conversation

rakuco
Copy link
Contributor

@rakuco rakuco commented Nov 25, 2016

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 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.

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 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
Copy link
Contributor

emaste commented Nov 25, 2016

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

@davidchisnall davidchisnall merged commit 0eb158a into davidchisnall:master Nov 26, 2016
@rakuco rakuco deleted the strchr-const-char branch November 26, 2016 12:36
uqs pushed a commit to freebsd/freebsd-src that referenced this pull request Nov 26, 2016
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 davidchisnall/dtc#14

Reviewed by:	emaste
Approved by:	emaste


git-svn-id: svn+ssh://svn.freebsd.org/base/head@309191 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
uqs pushed a commit to freebsd/freebsd-src that referenced this pull request Nov 26, 2016
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 davidchisnall/dtc#14

Reviewed by:	emaste
Approved by:	emaste
bdrewery pushed a commit to bdrewery/freebsd that referenced this pull request Dec 2, 2016
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 davidchisnall/dtc#14

Reviewed by:	emaste
Approved by:	emaste


git-svn-id: svn+ssh://svn.freebsd.org/base/head@309191 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
uqs pushed a commit to freebsd/freebsd-src that referenced this pull request Dec 30, 2016
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 davidchisnall/dtc#14
dspinellis pushed a commit to dspinellis/unix-history-repo that referenced this pull request Jan 9, 2017
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 davidchisnall/dtc#14
dspinellis pushed a commit to dspinellis/unix-history-repo that referenced this pull request Jan 12, 2017
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 davidchisnall/dtc#14
dspinellis pushed a commit to dspinellis/unix-history-repo that referenced this pull request Mar 25, 2017
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 davidchisnall/dtc#14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants