linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vitalii Demianets <vitas@nppfactor.kiev.ua>
To: linux-kernel@vger.kernel.org
Cc: "Hans J. Koch" <hjk@hansjkoch.de>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized
Date: Tue, 27 Nov 2012 14:24:45 +0200	[thread overview]
Message-ID: <201211271424.45588.vitas@nppfactor.kiev.ua> (raw)
In-Reply-To: <201211271348.14603.vitas@nppfactor.kiev.ua>

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-frame-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

  reply	other threads:[~2012-11-27 12:24 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-27 11:48 [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized Vitalii Demianets
2012-11-27 12:24 ` Vitalii Demianets [this message]
2012-11-27 22:43 ` Hans J. Koch
2012-11-28  8:58   ` Vitalii Demianets
2012-11-28 21:05     ` Hans J. Koch
2012-11-29 16:05       ` Tux9
2012-11-29 16:22         ` Vitalii Demianets
2012-11-29 16:33           ` Cong Ding
2012-11-29 16:36           ` Vitalii Demianets
2012-11-29 23:58             ` Hans J. Koch
2012-11-30 11:12               ` Tux9
2012-11-30 21:33                 ` Hans J. Koch
2012-12-01  1:22                   ` Cong Ding
2012-12-01  3:56                     ` Hans J. Koch
2012-12-01  9:58                       ` Cong Ding
2012-12-03  7:51                         ` Hans J. Koch
2012-11-30 11:16               ` Vitalii Demianets
2012-11-30 21:39                 ` Hans J. Koch
2012-11-30 23:43                   ` Greg Kroah-Hartman
2012-12-03  7:41                     ` [PATCH] stable: uio: " Hans J. Koch
2012-12-03 13:38                       ` Ben Hutchings
2012-12-03  8:35                   ` [PATCH] uio.c: " Vitalii Demianets
2012-12-03  8:53                     ` Vitalii Demianets
2012-12-03 17:27                       ` Hans J. Koch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201211271424.45588.vitas@nppfactor.kiev.ua \
    --to=vitas@nppfactor.kiev.ua \
    --cc=gregkh@linuxfoundation.org \
    --cc=hjk@hansjkoch.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).