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

cannot initialize a variable of type 'char *' with an rvalue of type 'const char *' #6575

Closed
DorpsGek opened this issue Jun 18, 2017 · 2 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

kencu opened the ticket and wrote:

Newer compilers (this was found while using clang-3.9 on MacOSX) raise the following line of code to an error.

char *app_bundle = strchr(exe, '.');

This was found here:

src/fileio.cpp:1037:8

The fix appears to be a simple cast:

char *app_bundle = (char *)strchr(exe, '.');

Which allows the compile to succeed.

Reported version: 1.7.1
Operating system: Mac OS X


This issue was imported from FlySpray: https://bugs.openttd.org/task/6575
@DorpsGek
Copy link
Member Author

frosch wrote:

I would think the reverse it true.
All const_casts in ChangeWorkingDirectoryToExecutable are invalid. "exe" is not supposed to be modified, but line 1044 does.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6575#comment14448

@DorpsGek
Copy link
Member Author

frosch closed the ticket.

Reason for closing: Fixed

in r27886


This comment was imported from FlySpray: https://bugs.openttd.org/task/6575

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant