Skip to content
Snippets Groups Projects

Fix int-in-bool-context with gcc-7.2

Merged Loic Hausammann requested to merge fix_gcc7 into master

With GCC-7.2.0, I am getting the following error: scheduler.c:1606:14: error: ‘<<’ in boolean context, did you mean ‘<’ ? [-Werror=int-in-bool-context] if (!((1 << t->type)) || t->skip) continue; ~~~~^~~~~~~~~~~~

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1603 1604
1604 1605 for (int k = nr_tasks - 1; k >= 0; k--) {
1605 1606 t = &tasks[tid[k]];
1606 if (!((1 << t->type)) || t->skip) continue;
1607 test_type = 1 << t->type;
1608 if (!(test_type) || t->skip) continue;
1607 1609 fprintf(file, "%d %s %s %d %d\n", k, taskID_names[t->type],
  • This is a noop as t->type is always 0 or greater, so in fact it needs to just retain the t->skip part of the test.

    Looks like some cruft left from years ago.

  • BTW, in general I'd assign numerical fixes to Matthieu, but don't worry about it we'll reassign as necessary.

  • Loic Hausammann Added 1 commit:

    Added 1 commit:

  • Unable to load the diff
  • Thanks, looks good to me.

  • Peter W. Draper mentioned in commit 929df6d8

    mentioned in commit 929df6d8

  • Peter W. Draper Status changed to merged

    Status changed to merged

  • Thanks! Glad to see bugs fixed before I even wake up. :smile:

  • Please register or sign in to reply
    Loading