From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NH2ds-0000lJ-WE for mharc-grub-devel@gnu.org; Sat, 05 Dec 2009 16:58:17 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NH2dp-0000i7-2d for grub-devel@gnu.org; Sat, 05 Dec 2009 16:58:13 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NH2dj-0000cd-GF for grub-devel@gnu.org; Sat, 05 Dec 2009 16:58:11 -0500 Received: from [199.232.76.173] (port=44607 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NH2dj-0000cW-3z for grub-devel@gnu.org; Sat, 05 Dec 2009 16:58:07 -0500 Received: from eir.is.scarlet.be ([193.74.71.27]:36445) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NH2di-0005Sk-KU for grub-devel@gnu.org; Sat, 05 Dec 2009 16:58:06 -0500 Received: from [213.49.103.50] (ip-213-49-103-50.dsl.scarlet.be [213.49.103.50]) (authenticated bits=0) by eir.is.scarlet.be (8.14.2/8.14.2) with ESMTP id nB5Lw1tg005019; Sat, 5 Dec 2009 22:58:02 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=scarlet.be; s=scarlet; t=1260050283; bh=dU37PdvZzwK8htR1q47U/ygs4vpAhNSmyj/AqN0WuSc=; h=Message-ID:Date:From:MIME-Version:To:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=HRspZGQCh3fYUbX5jvbKBr+/hlWpYRMIYDR3IeRUj07aAU/59GvdiBKWbXJMP5q6B staUojDpQvoVchw4Mtt9FgBj61/L4VyOp47ZU1oNlwcAyRckDLcClJZ8KcukUMJEqz fhLX86zbiPcAmhePujKLPMJjtrB4mi5jJJ7gs/pM= Message-ID: <4B1AD769.6030208@scarlet.be> Date: Sat, 05 Dec 2009 21:58:01 +0000 From: rubisher User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20091109) MIME-Version: 1.0 To: The development of GNU GRUB References: <4B093833.4020903@scarlet.be> <20091123144428.GA9295@thorin> <4B116A20.5030003@scarlet.be> <20091129091919.GY6439@riva.ucam.org> In-Reply-To: <20091129091919.GY6439@riva.ucam.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-scarlet.be-Metrics: eir 20001; Body=2 Fuz1=2 Fuz2=2 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: Just a cosmetic question about grub_vprintf()? X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 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, 05 Dec 2009 21:58:13 -0000 Colin Watson wrote: > On Sat, Nov 28, 2009 at 06:21:20PM +0000, rubisher wrote: >> Robert Millan wrote: >>> On Sun, Nov 22, 2009 at 01:10:11PM +0000, rubisher wrote: >>>> But as far as the 1st parameter of grub_vsprintf is a pointer, >>>> wouldn't it be better to write: >>>> --- kern/misc.c.orig 2009-11-22 13:07:22.000000000 +0000 >>>> +++ kern/misc.c 2009-11-22 13:07:51.000000000 +0000 >>>> @@ -160,7 +160,7 @@ >>>> { >>>> int ret; >>>> >>>> - ret = grub_vsprintf (0, fmt, args); >>>> + ret = grub_vsprintf (NULL, fmt, args); >>>> return ret; >>>> } >>> Yes. But we have many of those, so we don't go huntin' them. If you'd >>> like to help us, a patch that does this change in bulk would be welcome. >> It will be of great pleasure for me, but I didn't foreseen so much (the >> most difficult to me are 'opaque pointer') but I hoppe that such 'sparse' >> would help me for the most ;<) > > If you do this, make sure you understand why it makes no difference in > standards-compliant C. In particular, this understanding matters when > functions with variable-length argument lists are concerned. > > (See the C FAQ for more details.) > Ok, I will take care. In the mean time I just have enough time to try this diff to add enable-sparse option using cgcc wrapper: --- configure.ac 2009-12-05 10:12:22 +0000 +++ configure.ac 2009-12-05 19:14:14 +0000 @@ -537,6 +537,20 @@ [AC_DEFINE([MM_DEBUG], [1], [Define to 1 if you enable memory manager debugging.])]) +AC_ARG_ENABLE([sparse], + AS_HELP_STRING([--enable-sparse], + [enable sparse code checking]), , + enable_sparse=no +) + +# Set cgcc as compiler and add sparse flags if --enable-sparse was specified. +if test "$enable_sparse" = "yes"; then + CC="REAL_CC=$CC cgcc" + CFLAGS="$CFLAGS -Wbitwise -Wnon-pointer-null" + TARGET_CC="REAL_CC=$TARGET_CC cgcc" + TARGET_CFLAGS="$TARGET_CFLAGS -Wbitwise -Wnon-pointer-null" +fi + AC_ARG_ENABLE([grub-emu-usb], [AS_HELP_STRING([--enable-grub-emu-usb], [build and install the `grub-emu' debugging utility with USB support (default=guessed)])]) === <> === That seems to works on my side but all advise are welcome ;<) Tx, J.