lkml.org 
[lkml]   [2012]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized
Date
By the way, I've found that warning while working on the older kernel with 
older gcc (ver. 3.4.4). The modern gcc (ver. 4.5.4) does not emit that
warning no matter how hard I try. For example, it does not warn even with the
following line in the drivers/uio/Makefile:

ccflags-$(CONFIG_UIO) += -O2 -Wall -Wextra -Wuninitialized

In that case the actual command line looks like (from "make V=1" output):

gcc -Wp,-MD,drivers/uio/.uio.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/include -I/home/vitas/Progs/net-next/net-next/arch/x86/include -Iarch/x86/include/generated -Iinclude -I/home/vitas/Progs/net-next/net-next/arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I/home/vitas/Progs/net-next/net-next/include/uapi -Iinclude/generated/uapi -include /home/vitas/Progs/net-next/net-next/include/linux/kconfig.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_AVX=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -Wframe-larger-than=2048 -fno-stack-protector -fno-omit-fram
e-pointer -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -DCC_HAVE_ASM_GOTO -O2 -Wall -Wextra -Wuninitialized -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(uio)" -D"KBUILD_MODNAME=KBUILD_STR(uio)" -c -o
drivers/uio/uio.o drivers/uio/uio.c

I wander why doesn't modern gcc warn about obvious use of uninitialized
variable. Is it some known regression in gcc?

--
With Best Regards,
Vitalii Demianets


\
 
 \ /
  Last update: 2012-11-27 14:01    [W:0.070 / U:0.836 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site