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: converting the enum constant to a boolean (SC_KEY_TAGACTION) #186

Open
stbuehler opened this issue Oct 5, 2024 · 0 comments
Open

Comments

@stbuehler
Copy link
Contributor

Hi,

on my own branch (with a couple more fixes) there is one warning remaining that I don't know how to fix:

../src/ui.c:3755:29: warning: converting the enum constant to a boolean [-Wint-in-bool-context]
     (keytagactive == FALSE && SC_KEY_TAGACTION)) && ic != -1) {

apt-dater/src/ui.c

Lines 3754 to 3760 in 113ea9b

if(((keytagactive == TRUE && sc != SC_KEY_TAGACTION) ||
(keytagactive == FALSE && SC_KEY_TAGACTION)) && ic != -1) {
keytagactive = FALSE;
refscr = TRUE;
curs_set(0);
remln(COLS);
}

Now the enum constant isn't zero (afaict), so should evaluate to true, and one could simply remove && SC_KEY_TAGACTION to remove the warning and keep the current semantic, but that probably wasn't the intention.

Other options probably are sc == SC_KEY_TAGACTION or sc != SC_KEY_TAGACTION (but the latter would reduce the whole condition to sc != SC_KEY_TAGACTION && ic != -1, ignoring keytagactive).

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

No branches or pull requests

1 participant