tobimensch / aqemu

Official AQEMU repository - a GUI for virtual machines using QEMU as the backend
https://sourceforge.net/projects/aqemu/
GNU General Public License v2.0
502 stars 88 forks source link

src/VM.cpp: 3 * bad precedence ? #119

Open dcb314 opened 2 years ago

dcb314 commented 2 years ago

I just compiled the package with new C compiler clang-14. It said:

aqemu-0.9.2/src/VM.cpp:5875:71: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Wparentheses]

Source code is

                nic_str += ",restrict=" + Network_Cards_Nativ[nc].Get_Restrict() ? "y" : "n";

Suggest new code:

                nic_str += ",restrict=" + (Network_Cards_Nativ[nc].Get_Restrict() ? "y" : "n");

Also:

aqemu-0.9.2/src/VM.cpp:5920:73: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Wparentheses] aqemu-0.9.2/src/VM.cpp:5923:67: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Wparentheses]

Duplicates.