Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-8080

gcc-5 compile warnings -Wparentheses - mixing logical and bitwise operators

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.0.17
    • Fix Version/s: 10.0
    • Labels:
      None
    • Environment:
      gcc-5 / ubuntu-12.04

      Description

      https://travis-ci.org/openquery/mariadb-server/jobs/60545852

      looks like ! (logic negate) should be ~ (bitwise negate) to work with &.

      /home/travis/build/openquery/mariadb-server/sql/sql_select.cc: In function ‘double table_multi_eq_cond_selectivity(JOIN*, uint, JOIN_TAB*, table_map, uint, uint16*)’:
      /home/travis/build/openquery/mariadb-server/sql/sql_select.cc:7304:26: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
               if (!fld->table->map & ~(table_bit | rem_tables))
                                ^
      /home/travis/build/openquery/mariadb-server/sql/sql_select.cc: In function ‘int test_if_order_by_key(ORDER*, TABLE*, uint, uint*)’:
      /home/travis/build/openquery/mariadb-server/sql/sql_select.cc:20052:50: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
           if (!table->file->index_flags(pk, pk_parts, 1) & HA_READ_PREV)
      
      In file included from /home/travis/build/openquery/mariadb-server/storage/xtradb/include/log0recv.h:29:0,
                       from /home/travis/build/openquery/mariadb-server/storage/xtradb/log/log0recv.cc:33:
      /home/travis/build/openquery/mariadb-server/storage/xtradb/log/log0recv.cc: In function ‘void recv_apply_hashed_log_recs(ulint)’:
      /home/travis/build/openquery/mariadb-server/storage/xtradb/log/log0recv.cc:1944:20: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
        ut_ad(!allow_ibuf == mutex_own(&log_sys->mutex));
                          ^
      /home/travis/build/openquery/mariadb-server/storage/xtradb/include/univ.i:631:35: note: in definition of macro ‘UNIV_EXPECT’
       # define UNIV_EXPECT(expr,value) (expr)
                                         ^
      /home/travis/build/openquery/mariadb-server/storage/xtradb/include/ut0dbg.h:43:28: note: in expansion of macro ‘UNIV_UNLIKELY’
       # define UT_DBG_FAIL(EXPR) UNIV_UNLIKELY(!((ulint)(EXPR)))
                                  ^
      /home/travis/build/openquery/mariadb-server/storage/xtradb/include/ut0dbg.h:70:6: note: in expansion of macro ‘UT_DBG_FAIL’
        if (UT_DBG_FAIL(EXPR)) {    \
            ^
      /home/travis/build/openquery/mariadb-server/storage/xtradb/include/ut0dbg.h:85:21: note: in expansion of macro ‘ut_a’
       #define ut_ad(EXPR) ut_a(EXPR)
                           ^
      /home/travis/build/openquery/mariadb-server/storage/xtradb/log/log0recv.cc:1944:2: note: in expansion of macro ‘ut_ad’
        ut_ad(!allow_ibuf == mutex_own(&log_sys->mutex));
      
      /home/travis/build/openquery/mariadb-server/storage/xtradb/btr/btr0cur.cc: In function ‘dberr_t btr_cur_pessimistic_insert(ulint, btr_cur_t*, ulint**, mem_heap_t**, dtuple_t*, rec_t**, big_rec_t**, ulint, que_thr_t*, mtr_t*)’:
      /home/travis/build/openquery/mariadb-server/storage/xtradb/btr/btr0cur.cc:1749:36: warning: null argument where non-null required (argument 1) [-Wnonnull]
           btr_cur_get_block(cursor)), mtr)
                                          ^
      
      [ 24%] /home/travis/build/openquery/mariadb-server/storage/xtradb/btr/btr0scrub.cc: In function ‘int btr_scrub_page(btr_scrub_t*, buf_block_t*, btr_scrub_page_allocation_status_t, mtr_t*)’:
      /home/travis/build/openquery/mariadb-server/storage/xtradb/btr/btr0scrub.cc:787:54: warning: null argument where non-null required (argument 1) [-Wnonnull]
        if (btr_page_get_index_id(buf_block_get_frame(block)) !=
                                           
      

        Gliffy Diagrams

          Attachments

            Activity

            There are no comments yet on this issue.

              People

              • Assignee:
                serg Sergei Golubchik
                Reporter:
                danblack Daniel Black
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: