Projects
home:lf14:branches:Mega:23.09
glibc
_service:tar_scm:backport-clang-0016-elf-Supres...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:backport-clang-0016-elf-Supress-clang-Wsometimes-uninitialized-on.patch of Package glibc
From 6248c3674e9acbc33afed2a65d4916cbb9873a77 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Wed, 24 Aug 2022 12:25:05 -0300 Subject: [PATCH] elf: Supress clang -Wsometimes-uninitialized on _dl_debug_initialize clang issues an warning where variable 'r' is used uninitialized whenever 'if' condition is false. The _dl_debug_initialize is called for static case always with LM_ID_BASE (csu/libc-start.c and elf/dl-reloc-static-pie.c) and DL_NSS will be always larger than 1 for shared case. --- elf/dl-debug.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/elf/dl-debug.c b/elf/dl-debug.c index bd7b1cc8f7..3c4476c22c 100644 --- a/elf/dl-debug.c +++ b/elf/dl-debug.c @@ -17,6 +17,7 @@ <https://www.gnu.org/licenses/>. */ #include <ldsodefs.h> +#include <libc-diag.h> /* These are the members in the public `struct link_map' type. @@ -54,7 +55,15 @@ _dl_debug_update (Lmid_t ns) struct r_debug * _dl_debug_initialize (ElfW(Addr) ldbase, Lmid_t ns) { - struct r_debug_extended *r, **pp = NULL; + /* clang issues an warning where variable 'r' is used uninitialized whenever + 'if' condition is false. The _dl_debug_initialize is called for static + case always with LM_ID_BASE (csu/libc-start.c and + elf/dl-reloc-static-pie.c) and DL_NSS will be always larger than 1 for + shared case. */ + DIAG_PUSH_NEEDS_COMMENT_CLANG; + DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wsometimes-uninitialized"); + struct r_debug_extended *r; + struct r_debug_extended **pp = NULL; if (ns == LM_ID_BASE) { @@ -81,6 +90,7 @@ _dl_debug_initialize (ElfW(Addr) ldbase, Lmid_t ns) r->base.r_version = 2; } } + DIAG_POP_NEEDS_COMMENT_CLANG; if (r->base.r_brk == 0) { -- 2.39.3
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2