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

Warning compiling with gcc 5.1.0 #6306

Closed
DorpsGek opened this issue May 24, 2015 · 2 comments
Closed

Warning compiling with gcc 5.1.0 #6306

DorpsGek opened this issue May 24, 2015 · 2 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

Cif opened the ticket and wrote:

On ArchLinux with gcc 5.1.0 this warning appear:

[SRC] Compiling group_gui.cpp
/home/cifvts/projects/openttd-git/src/group_gui.cpp: In member function ‘virtual void VehicleGroupWindow::OnClick(Point, int, int)’:
/home/cifvts/projects/openttd-git/src/group_gui.cpp:672:41: warning: suggest parentheses around operand of ‘!’ or change ‘|’ to ‘||’ or ‘!’ to ‘~’ [-Wparentheses]
      DoCommandP(0, this->vli.index, !g->replace_protection | (_ctrl_pressed << 1), CMD_SET_GROUP_REPLACE_PROTECTION);
                                         ^

Attached is a patch that mute this warning.

Attachments

Reported version: trunk
Operating system: Linux


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

Alberth wrote:

Hmm, boolean value combined with integer number?
May I suggest you do a proper conversion from boolean to integer here?


This comment was imported from FlySpray: https://bugs.openttd.org/task/6306#comment13928

@DorpsGek
Copy link
Member Author

frosch closed the ticket.

Reason for closing: Fixed

in r27300


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

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay 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/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

1 participant