From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Rto9H-0004H4-Hq for mharc-grub-devel@gnu.org; Sat, 04 Feb 2012 17:31:59 -0500 Received: from eggs.gnu.org ([140.186.70.92]:36317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rto9D-0004CC-Nn for grub-devel@gnu.org; Sat, 04 Feb 2012 17:31:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rto9B-00067H-Np for grub-devel@gnu.org; Sat, 04 Feb 2012 17:31:55 -0500 Received: from mail-wi0-f169.google.com ([209.85.212.169]:37624) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rto9B-00067A-9B for grub-devel@gnu.org; Sat, 04 Feb 2012 17:31:53 -0500 Received: by wibhj13 with SMTP id hj13so4824284wib.0 for ; Sat, 04 Feb 2012 14:31:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=eUMaC7/9ghQaYKDzOJhGcBuJ1NK9/apIS9GxqNceL1c=; b=fTAWSJupk/DRlm1jN7134j6iLSW8s3rNsNnYvMoVVVHAF1lBG3Vgp/XJXBVRXvOL/j 9DLxyz65guZSztDCaX/edMYqTPHd6wdQt4AZGiG7rgLFGQH67fNtrPJAEMQ0zOMsg6fa mLHMDt2KAfpprz33Pj7pKB6mEA7yYQuxxELsA= Received: by 10.180.82.39 with SMTP id f7mr6144402wiy.19.1328394712307; Sat, 04 Feb 2012 14:31:52 -0800 (PST) Received: from fedora.x201.phnet (79-5.62-81.cust.bluewin.ch. [81.62.5.79]) by mx.google.com with ESMTPS id bj10sm15405011wib.9.2012.02.04.14.31.50 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 04 Feb 2012 14:31:50 -0800 (PST) Message-ID: <4F2DB1D5.8070200@gmail.com> Date: Sat, 04 Feb 2012 23:31:49 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20120131 Thunderbird/10.0 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: Build break (uninitialized variable) References: <4F2C26C3.6050804@gmail.com> In-Reply-To: <4F2C26C3.6050804@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.212.169 Cc: =?UTF-8?B?R3LDqWdvaXJlIFN1dHJl?= X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Feb 2012 22:31:57 -0000 On 03.02.2012 19:26, Grégoire Sutre wrote: > The compiler complains about `totsize' being possibly uninitialized > in grub-core/disk/diskfilter.c, function grub_diskfilter_make_raid(). > I get this error with gcc 4.5.3 on NetBSD, and also with gcc 4.6.2 on > Debian GNU/Linux. > > I'm not familiar with that code. The attached patch fixes this by > returning NULL when the argument `level' has an unexpected value. > I've looked at other code and seen that return NULL will result in the skipping of those devices altogether, exactly what we want. So I think it's a reasonable behaviour for this function. So go ahead > Grégoire > > gcc -DHAVE_CONFIG_H -I. -I.. -Wall -W -I../include -I../include > -DGRUB_MACHINE_PCBIOS=1 -DGRUB_MACHINE=I386_PC > -DGRUB_TARGET_CPU_I386=1 -m32 -DGRUB_FILE=\"disk/diskfilter.c\" -I. > -I. -I.. -I.. -I../include -I../include -Os -Wall -W -Wshadow > -Wpointer-arith -Wmissing-prototypes -Wundef -Wstrict-prototypes -g > -falign-jumps=1 -falign-loops=1 -falign-functions=1 -mno-mmx -mno-sse > -mno-sse2 -mno-3dnow -fno-dwarf2-cfi-asm > -fno-asynchronous-unwind-tables -m32 -fno-stack-protector > -mno-stack-arg-probe -Werror -mrtd -mregparm=3 -ffreestanding > -MT disk/diskfilter_module-diskfilter.o -MD -MP -MF > disk/.deps-core/diskfilter_module-diskfilter.Tpo -c -o > disk/diskfilter_module-diskfilter.o `test -f 'disk/diskfilter.c' || > echo './'`disk/diskfilter.c > cc1: warnings being treated as errors > disk/diskfilter.c: In function 'grub_diskfilter_make_raid': > disk/diskfilter.c:813:17: error: 'totsize' may be used uninitialized > in this function > gmake[3]: *** [disk/diskfilter_module-diskfilter.o] Error 1 > gmake[3]: Leaving directory `/tmp/grub/grub-core' > gmake[2]: *** [all] Error 2 > gmake[2]: Leaving directory `/tmp/grub/grub-core' > gmake[1]: *** [all-recursive] Error 1 > gmake[1]: Leaving directory `/tmp/grub' > gmake: *** [all] Error 2 > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel -- Regards Vladimir 'φ-coder/phcoder' Serbinenko