Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-11197

Compiler warnings with gcc 6.2.1

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Won't fix
    • Icon: Trivial Trivial
    • None
    • 3.2.0rc2
    • Installation (I)

      Here are a couple of compiler warnings I'm getting in Fedora Rawhide with gcc 6.2.1-1.fc26 you may want to review:

      prediction.c: In function 'zbx_timeleft':
      prediction.c:833:11: warning: 'result' may be used uninitialized in this function [-Wmaybe-uninitialized]
         *result -= now;
                 ^~
      prediction.c:1148:19: note: 'result' was declared here
        double  current, result;
                         ^~~~~~
      
      dbupgrade_3010.c: In function 'DBpatch_3010026_expression_remove_values_impl':
      dbupgrade_3010.c:980:66: warning: 'value_token.r' may be used uninitialized in this function [-Wmaybe-uninitialized]
           DBpatch_3010026_expression_move_location(&token, -(cut_loc.r - cut_loc.l + 1));
                                                              ~~~~~~~~~~^~~~~~~~~~~
      dbupgrade_3010.c:993:66: warning: 'value_token.l' may be used uninitialized in this function [-Wmaybe-uninitialized]
           DBpatch_3010026_expression_move_location(&token, -(cut_loc.r - cut_loc.l + 1));
                                                              ~~~~~~~~~~^~~~~~~~~~~
      dbupgrade_3010.c:980:66: warning: 'op_token.l' may be used uninitialized in this function [-Wmaybe-uninitialized]
           DBpatch_3010026_expression_move_location(&token, -(cut_loc.r - cut_loc.l + 1));
                                                              ~~~~~~~~~~^~~~~~~~~~~
      
      evalfunc.c: In function 'evaluate_COUNT':
      evalfunc.c:415:26: warning: 'arg2_dbl' may be used uninitialized in this function [-Wmaybe-uninitialized]
          if (!(value > pattern - ZBX_DOUBLE_EPSILON && value < pattern + ZBX_DOUBLE_EPSILON))
                                 
      evalfunc.c:498:12: note: 'arg2_dbl' was declared here
        double    arg2_dbl;
                  ^~~~~~~~
      
      active.c: In function 'active_checks_thread':
      active.c:1245:24: warning: 'lastlogsize_orig' may be used uninitialized in this function [-Wmaybe-uninitialized]
          metric->lastlogsize = lastlogsize_orig;
          ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
      active.c:1043:16: note: 'lastlogsize_orig' was declared here
        zbx_uint64_t  lastlogsize_orig;
                      ^~~~~~~~~~~~~~~~
      active.c:1247:20: warning: 'big_rec_orig' may be used uninitialized in this function [-Wmaybe-uninitialized]
          metric->big_rec = big_rec_orig;
          ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
      active.c:1042:17: note: 'big_rec_orig' was declared here
           mtime_orig, big_rec_orig, logfiles_num_new = 0, jumped = 0;
                       ^~~~~~~~~~~~
      active.c:1246:18: warning: 'mtime_orig' may be used uninitialized in this function [-Wmaybe-uninitialized]
          metric->mtime =  mtime_orig;
          ~~~~~~~~~~~~~~^~~~~~~~~~~~~
      active.c:1042:5: note: 'mtime_orig' was declared here
           mtime_orig, big_rec_orig, logfiles_num_new = 0, jumped = 0;
           ^~~~~~~~~~
      active.c:1203:16: warning: 's_count_orig' may be used uninitialized in this function [-Wmaybe-uninitialized]
          match_count = s_count_orig - s_count;
          ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
      active.c:1041:44: note: 's_count_orig' was declared here
        int   rate, ret = FAIL, s_count, p_count, s_count_orig, is_count_item, max_delay_par_nr,
                                                  ^~~~~~~~~~~~
      
      lld_trigger.c: In function 'lld_triggers_save.isra.18':
      lld_trigger.c:2595:5: warning: 'triggertagid' may be used uninitialized in this function [-Wmaybe-uninitialized]
           zbx_db_insert_add_values(&db_insert_ttags, tag->triggertagid, trigger->triggerid,
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             tag->tag, tag->value);
             ~~~~~~~~~~~~~~~~~~~~~
      

      See ZBX-9836 for some of the warnings that already existed in 2.4.

            Unassigned Unassigned
            volter Volker Fröhlich
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: