On 2019年04月08日 22:21, Jeff Law wrote:
On 4/8/19 12:34 AM, mingli...@windriver.com wrote:
From: Mingli Yu <mingli...@windriver.com>
Initialize struct stat to fix the below
build failure when -Og included in compiler flag.
|
./../../../../../../../../work-shared/gcc-8.3.0-r0/gcc-8.3.0/libsanitizer/libbacktrace/../../libbacktrace/elf.c:
In function 'elf_is_symlink':
|
../../../../../../../../../work-shared/gcc-8.3.0-r0/gcc-8.3.0/libsanitizer/libbacktrace/../../libbacktrace/elf.c:772:21:
error: 'st.st_mode' may be used uninitialized in this function
[-Werror=maybe-uninitialized]
return S_ISLNK (st.st_mode);
Signed-off-by: Mingli Yu <mingli...@windriver.com>
---
libbacktrace/elf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
This is a false positive in -Wuninitialized that can be worked around by
compiling with -O2. Please do that rather than compiling with -Og.
Thanks Jeff for your respond!
Hi Khem,
If so, do we need to just to add some logic as DEBUG_OPTIMIZATION_append
= " -Wno-error" for gcc-sanitizers to avoid -Og indicating the
-Werror=maybe-uninitialized message?
Thanks,
jeff