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

Compiler warnings in host.c

XMLWordPrintable

    • Sprint 53 (Jun 2019), Sprint 54 (Jul 2019)
    • 0.125

      Steps to reproduce:

      1. Compile Zabbix server or proxy from source using -O2 -Wall
        Making all in zbxdbhigh
        host.c: In function ‘DBcopy_template_host_prototypes’:
        host.c:3360:80: warning: ‘host_prototype’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             group_prototype = (zbx_group_prototype_t *)host_prototype->group_prototypes.values[i];
                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
        host.c:3265:24: note: ‘host_prototype’ was declared here
          zbx_host_prototype_t *host_prototype;
                                ^~~~~~~~~~~~~~
        host.c:3227:47: warning: ‘host_prototype’ may be used uninitialized in this function [-Wmaybe-uninitialized]
            if (FAIL == (i = zbx_vector_uint64_bsearch(&host_prototype->lnk_templateids, templateid,
                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        host.c:3140:24: note: ‘host_prototype’ was declared here
          zbx_host_prototype_t *host_prototype;
                                ^~~~~~~~~~~~~~
        

      Result:

      Expected:
      No warnings. See host.patch.

            asestakovs Aleksejs Sestakovs
            cyclone Glebs Ivanovskis
            Team C
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: