[ZBX-16207] Avoidable compiler warning in proxy.c Created: 2019 Jun 03 Updated: 2019 Jul 22 Resolved: 2019 Jul 22 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Proxy (P), Server (S) |
Affects Version/s: | 4.2.4rc1, 4.4.0alpha1 |
Fix Version/s: | 4.2.5rc1, 4.4.0alpha1, 4.4 (plan) |
Type: | Problem report | Priority: | Trivial |
Reporter: | Glebs Ivanovskis | Assignee: | Viktors Tjarve |
Resolution: | Fixed | Votes: | 0 |
Labels: | codequality, networkdiscovery, pach | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: | proxy.patch |
Team: | Team A |
Sprint: | Sprint 53 (Jun 2019), Sprint 54 (Jul 2019) |
Story Points: | 0.125 |
Description |
Steps to reproduce:
Result: Making all in zbxdbhigh proxy.c: In function ‘process_discovery_data_contents’: proxy.c:3442:8: warning: ‘services_num’ may be used uninitialized in this function [-Wmaybe-uninitialized] int services_num, ret = FAIL, i; ^~~~~~~~~~~~ Expected: |
Comments |
Comment by Vladislavs Sokurenko [ 2019 Jun 11 ] |
I don't see such warning on gcc (GCC) 9.1.1 20190503 (Red Hat 9.1.1-1) |
Comment by Glebs Ivanovskis [ 2019 Jun 11 ] |
Which compiler flags do you use? |
Comment by Vladislavs Sokurenko [ 2019 Jun 11 ] |
The most important part is: -g -O0 -Wall -Wextra" I can reproduce the issue if changed to: -g -O2 -Wall -Wextra" |
Comment by Glebs Ivanovskis [ 2019 Jun 11 ] |
Yes, -Wmaybe-uninitialized relies on optimizer data.
|
Comment by Vladislavs Sokurenko [ 2019 Jun 12 ] |
Event though a false positive it is better to get rid of such warnings if easily possible |
Comment by Viktors Tjarve [ 2019 Jul 09 ] |
Releases in:
|