ricardoquesada / vchar64

editor for the Commodore 64
http://retro.moe/tag/vchar64/
Other
91 stars 12 forks source link

GCC 7.2.1 -Werror=int-in-bool-context #51

Closed sajattack closed 6 years ago

sajattack commented 6 years ago

When running make with gcc 7.2.1, I get this error:

../../src/importkoaladialog.cpp:216:27: error: ‘<<’ in boolean context, did you mean ‘<’ ? [-Werror=int-in-bool-context]
             if (mask && (1<<i))
sajattack commented 6 years ago

The resolution appears to be adding -Wno-int-in-bool-context to CXXFLAGS, but I'm struggling to do so with qmake. I added QMAKE_CXXFLAGS_RELEASE += -Wno-int-in-bool-context to vchar64.pro but that didn't do anything and I can't figure out why. My only solution has been to edit Makefile.Release manually.

ricardoquesada commented 6 years ago

thanks. I'll try to fix it for the next release.

mrdudz commented 6 years ago

the whole expression does not make sense - what are you trying to do there? (1<<i) is always 1 or greater, ie always true. you can just as well write if (mask) - which is why the compiler complains. perhaps what you really wanted to do is if (mask & (1<<i)) ?

ricardoquesada commented 6 years ago

thanks. fixed here: https://github.com/ricardoquesada/vchar64/commit/b4909320977c25d1952d537ff4fec3e5d2c6b9e4