From 6ced2634774cd8a26dad97fd6c2d4f1c872e9a6e Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 16 May 2023 11:20:38 -0400 Subject: [PATCH] MT#55283 add -Wshadow Change-Id: If827311cbbbba48b3f483a4e2a3fc1dc7a957e4e --- daemon/.ycm_extra_conf.py | 1 + daemon/Makefile | 3 ++- lib/.ycm_extra_conf.py | 1 + recording-daemon/.ycm_extra_conf.py | 1 + recording-daemon/Makefile | 3 ++- t/Makefile | 3 ++- 6 files changed, 9 insertions(+), 3 deletions(-) diff --git a/daemon/.ycm_extra_conf.py b/daemon/.ycm_extra_conf.py index cfae3919c..d4532a34f 100644 --- a/daemon/.ycm_extra_conf.py +++ b/daemon/.ycm_extra_conf.py @@ -24,6 +24,7 @@ flags = [ '-g', '-Wall', '-Wstrict-prototypes', + '-Wshadow', '-pthread', '-fno-strict-aliasing', '-I/usr/include/glib-2.0', diff --git a/daemon/Makefile b/daemon/Makefile index 9b468cf4a..c170923e4 100644 --- a/daemon/Makefile +++ b/daemon/Makefile @@ -4,7 +4,8 @@ with_iptables_option ?= yes with_transcoding ?= yes -CFLAGS?= -g -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wstrict-prototypes -Werror=return-type +CFLAGS?= -g -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wstrict-prototypes -Werror=return-type \ + -Wshadow CFLAGS+= -pthread -fno-strict-aliasing CFLAGS+= -std=c99 CFLAGS+= $(shell pkg-config --cflags glib-2.0) diff --git a/lib/.ycm_extra_conf.py b/lib/.ycm_extra_conf.py index 4713bbd5c..e5ac69290 100644 --- a/lib/.ycm_extra_conf.py +++ b/lib/.ycm_extra_conf.py @@ -24,6 +24,7 @@ flags = [ '-g', '-Wall', '-Wstrict-prototypes', + '-Wshadow', '-pthread', '-fno-strict-aliasing', '-I/usr/include/glib-2.0', diff --git a/recording-daemon/.ycm_extra_conf.py b/recording-daemon/.ycm_extra_conf.py index d9efec9ac..9fbff0eac 100644 --- a/recording-daemon/.ycm_extra_conf.py +++ b/recording-daemon/.ycm_extra_conf.py @@ -15,6 +15,7 @@ flags = [ '-g', '-Wall', '-Wstrict-prototypes', + '-Wshadow', '-pthread', '-fno-strict-aliasing', '-I/usr/include/glib-2.0', diff --git a/recording-daemon/Makefile b/recording-daemon/Makefile index 543b2d89c..ff633bbed 100644 --- a/recording-daemon/Makefile +++ b/recording-daemon/Makefile @@ -1,6 +1,7 @@ TARGET= rtpengine-recording -CFLAGS?= -g -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wstrict-prototypes -Werror=return-type +CFLAGS?= -g -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wstrict-prototypes -Werror=return-type \ + -Wshadow CFLAGS+= -pthread -I. -I../lib/ -I../kernel-module/ CFLAGS+= -std=c99 -fno-strict-aliasing CFLAGS+= -D_GNU_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE diff --git a/t/Makefile b/t/Makefile index 8fe89a583..42e4018b6 100644 --- a/t/Makefile +++ b/t/Makefile @@ -2,7 +2,8 @@ TARGET= all-tests with_transcoding ?= yes -CFLAGS?= -g -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wstrict-prototypes -Werror=return-type +CFLAGS?= -g -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wstrict-prototypes -Werror=return-type \ + -Wshadow PRELOAD_CFLAGS := $(CFLAGS) CFLAGS+= -pthread -fno-strict-aliasing CFLAGS+= -std=c99