[Bug general/21011] New: "may be used uninitialized" error with -Werror=maybe-uninitialized
luizluca at gmail dot com
sourceware-bugzilla@sourceware.org
Fri Dec 30 21:38:00 GMT 2016
https://sourceware.org/bugzilla/show_bug.cgi?id=21011
Bug ID: 21011
Summary: "may be used uninitialized" error with
-Werror=maybe-uninitialized
Product: elfutils
Version: unspecified
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: general
Assignee: unassigned at sourceware dot org
Reporter: luizluca at gmail dot com
CC: elfutils-devel at sourceware dot org
Target Milestone: ---
Hello,
I get this error when compiling with -Werror=maybe-uninitialized
elf_getarsym.c: In function 'elf_getarsym':
elf_getarsym.c:200:14: error: 'n' may be used uninitialized in this function
[-Werror=maybe-uninitialized]
size_t ar_sym_len = (n + 1) * sizeof (Elf_Arsym);
I know that read_number_entries define its values unconditionally but it won't
hurt to simply use:
uint64_t n = 0;
Is it ok?
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Elfutils-devel
mailing list