HomeClusterLabs Projects

links.c: Fix build with gcc-12

Description

links.c: Fix build with gcc-12

Fix the build failure with gcc-12 when -Og pass to CFLAGS.

| /build/tmp-glibc/work/corei7-64-wrs-linux/kronosnet/1.22-r0/recipe-sysroot/usr/include/bits/string_fortified.h:59:10: error: 'link' may be used uninitialized [-Werror=maybe-uninitialized]
|    59 |   return __builtin___memset_chk (__dest, __ch, __len,
|       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|    60 |                                  __glibc_objsize0 (__dest));
|       |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
| ../../git/libknet/links.c: In function 'knet_link_set_config':
| ../../git/libknet/links.c:108:27: note: 'link' was declared here
|   108 |         struct knet_link *link;
|       |                           ^~~~
| cc1: all warnings being treated as errors

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>

Details

Provenance
Mingli Yu <mingli.yu@windriver.com>Authored on Jun 9 2022, 4:03 AM
Parents
rKebc196a1400a: Merge pull request #380 from kronosnet/typo-fixes
Branches
Unknown
Tags
Unknown

Event Timeline

Mingli Yu <mingli.yu@windriver.com> committed rKc8e64233156d: links.c: Fix build with gcc-12 (authored by Mingli Yu <mingli.yu@windriver.com>).Jun 9 2022, 4:39 AM