Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1334495

Re: [PATCH 5/5] gcov: disable -Wmaybe-uninitialized warning

From Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH 5/5] gcov: disable -Wmaybe-uninitialized warning
Date 2016-02-15 15:40 +0100
Message-ID <r2stJ-2fA-47@gated-at.bofh.it> (permalink)
References <r1os9-Pl-5@gated-at.bofh.it> <r1osa-Pl-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 12.02.2016 17:06, Arnd Bergmann wrote:
> When gcov profiling is enabled, we see a lot of spurious warnings about
> possibly uninitialized variables being used:
> 
> arch/arm/mm/dma-mapping.c: In function 'arm_coherent_iommu_map_page':
> arch/arm/mm/dma-mapping.c:1085:16: warning: 'start' may be used uninitialized in this function [-Wmaybe-uninitialized]
> drivers/clk/st/clk-flexgen.c: In function 'st_of_flexgen_setup':
> drivers/clk/st/clk-flexgen.c:323:9: warning: 'num_parents' may be used uninitialized in this function [-Wmaybe-uninitialized]
> kernel/cgroup.c: In function 'cgroup_mount':
> kernel/cgroup.c:2119:11: warning: 'root' may be used uninitialized in this function [-Wmaybe-uninitialized]
> 
> All of these are false positives, so it seems better to just disable
> the warnings whenever GCOV is enabled. Most users don't enable GCOV,
> and based on a prior patch, it is now also disabled for 'allmodconfig'
> builds, so there should be no downsides of doing this.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Sounds sane.

Acked-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>

> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index 6bb89728a9d1..7b6900931a47 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -364,7 +364,7 @@ AFLAGS_MODULE   =
>  LDFLAGS_MODULE  =
>  CFLAGS_KERNEL	=
>  AFLAGS_KERNEL	=
> -CFLAGS_GCOV	= -fprofile-arcs -ftest-coverage -fno-tree-loop-im
> +CFLAGS_GCOV	= -fprofile-arcs -ftest-coverage -fno-tree-loop-im -Wno-maybe-uninitialized
>  CFLAGS_KCOV	= -fsanitize-coverage=trace-pc
> 
> 


-- 
Peter Oberparleiter
Linux on z Systems Development - IBM Germany

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] gcov fixes and maybe-uninitialized warnings Arnd Bergmann <arnd@arndb.de> - 2016-02-12 17:10 +0100
  [PATCH 5/5] gcov: disable -Wmaybe-uninitialized warning Arnd Bergmann <arnd@arndb.de> - 2016-02-12 17:10 +0100
    Re: [PATCH 5/5] gcov: disable -Wmaybe-uninitialized warning Peter Oberparleiter <oberpar@linux.vnet.ibm.com> - 2016-02-15 15:40 +0100
  [PATCH 2/5] Kbuild: disable 'maybe-uninitialized' warning for CONFIG_PROFILE_ALL_BRANCHES Arnd Bergmann <arnd@arndb.de> - 2016-02-12 17:10 +0100
    Re: [PATCH 2/5] Kbuild: disable 'maybe-uninitialized' warning for  CONFIG_PROFILE_ALL_BRANCHES Steven Rostedt <rostedt@goodmis.org> - 2016-02-15 18:50 +0100
  [PATCH 4/5] gcov: disable tree-loop-im to reduce stack usage Arnd Bergmann <arnd@arndb.de> - 2016-02-12 17:10 +0100
    Re: [PATCH 4/5] gcov: disable tree-loop-im to reduce stack usage Peter Oberparleiter <oberpar@linux.vnet.ibm.com> - 2016-02-15 15:40 +0100
  [PATCH 1/5] Kbuild: change CC_OPTIMIZE_FOR_SIZE definition Arnd Bergmann <arnd@arndb.de> - 2016-02-12 17:10 +0100

csiph-web