From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1RtNpx-0006dr-IY for mharc-grub-devel@gnu.org; Fri, 03 Feb 2012 13:26:17 -0500 Received: from eggs.gnu.org ([140.186.70.92]:51609) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtNpu-0006dl-Q8 for grub-devel@gnu.org; Fri, 03 Feb 2012 13:26:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RtNpt-00061d-IE for grub-devel@gnu.org; Fri, 03 Feb 2012 13:26:14 -0500 Received: from mail-wi0-f169.google.com ([209.85.212.169]:50706) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtNpt-00061N-2R for grub-devel@gnu.org; Fri, 03 Feb 2012 13:26:13 -0500 Received: by wibhj13 with SMTP id hj13so4031648wib.0 for ; Fri, 03 Feb 2012 10:26:12 -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:subject :content-type; bh=USpaFYR00p6yd5HfC6NycVbjQnECkw1YwoIpVCMPams=; b=Gv5kCXY26spU8SrzGHFjIEjZ+IV/hBhL7KFQF7bEkSHyMnghfpUFCcPrigsRaEXkCL iR6wcXLgwE27QCwTq+Z1VPYu13Xa/MwPFjMUCPF0mSA+5fa6uzuQbrIS4cgTYAk10ZAP N6olYZHM4uKQ1rss9lu042tSPkAshweMSemwc= Received: by 10.180.78.98 with SMTP id a2mr13301510wix.17.1328293572099; Fri, 03 Feb 2012 10:26:12 -0800 (PST) Received: from [192.168.1.37] (c2433-1-88-160-112-182.fbx.proxad.net. [88.160.112.182]) by mx.google.com with ESMTPS id cb8sm8351718wib.0.2012.02.03.10.26.10 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 03 Feb 2012 10:26:11 -0800 (PST) Message-ID: <4F2C26C3.6050804@gmail.com> Date: Fri, 03 Feb 2012 19:26:11 +0100 From: =?ISO-8859-1?Q?Gr=E9goire_Sutre?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111114 Iceowl/1.0b2 Icedove/3.1.16 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Build break (uninitialized variable) Content-Type: multipart/mixed; boundary="------------050205020802030509010603" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.212.169 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: Fri, 03 Feb 2012 18:26:16 -0000 This is a multi-part message in MIME format. --------------050205020802030509010603 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit 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. 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 --------------050205020802030509010603 Content-Type: text/x-patch; name="diskfilter-totsize.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="diskfilter-totsize.diff" === modified file 'grub-core/disk/diskfilter.c' --- grub-core/disk/diskfilter.c 2012-01-29 13:28:01 +0000 +++ grub-core/disk/diskfilter.c 2012-02-03 18:21:07 +0000 @@ -837,6 +837,9 @@ grub_diskfilter_make_raid (grub_size_t u case 6: totsize = (nmemb - level / 3) * disk_size; break; + + default: + return NULL; } array = grub_diskfilter_get_vg_by_uuid (uuidlen, uuid); --------------050205020802030509010603--