From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MIsKp-0008F6-4v for mharc-grub-devel@gnu.org; Mon, 22 Jun 2009 18:49:55 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MIsKm-0008DB-Os for grub-devel@gnu.org; Mon, 22 Jun 2009 18:49:52 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MIsKh-0008BV-VM for grub-devel@gnu.org; Mon, 22 Jun 2009 18:49:52 -0400 Received: from [199.232.76.173] (port=45666 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MIsKh-0008BA-Qe for grub-devel@gnu.org; Mon, 22 Jun 2009 18:49:47 -0400 Received: from c60.cesmail.net ([216.154.195.49]:30337) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1MIsKh-0003DG-9e for grub-devel@gnu.org; Mon, 22 Jun 2009 18:49:47 -0400 Received: from unknown (HELO smtprelay1.cesmail.net) ([192.168.1.111]) by c60.cesmail.net with ESMTP; 22 Jun 2009 18:49:45 -0400 Received: from [192.168.0.22] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by smtprelay1.cesmail.net (Postfix) with ESMTPSA id 6C80234C69 for ; Mon, 22 Jun 2009 18:49:44 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: References: <1245275268.32616.62.camel@mj> Content-Type: text/plain Date: Mon, 22 Jun 2009 18:49:31 -0400 Message-Id: <1245710971.6595.15.camel@mj> Mime-Version: 1.0 X-Mailer: Evolution 2.26.2 (2.26.2-1.fc11) Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: Warning free build achieved, coreboot documentation updated X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jun 2009 22:49:53 -0000 On Thu, 2009-06-18 at 02:25 +0200, Vladimir 'phcoder' Serbinenko wrote: > Index: util/hostdisk.c > =================================================================== > --- util/hostdisk.c (revision 2340) > +++ util/hostdisk.c (working copy) > @@ -344,7 +344,7 @@ > #else /* ! __linux__ */ > #if defined (__FreeBSD__) || defined(__FreeBSD_kernel__) > int sysctl_flags, sysctl_oldflags; > - const size_t sysctl_size = sizeof (sysctl_flags); > + size_t sysctl_size = sizeof (sysctl_flags); > > if (sysctlbyname ("kern.geom.debugflags", &sysctl_oldflags, > &sysctl_size, NULL, 0)) We use sysctl_size twice after that call. If it's not constant, chances are that it has changed. Shouldn't we revert to the original value, or should we use the returned value in the subsequent calls? I've seen that warning and I considered that patch, but I didn't have a chance to check the correctness of the change. Just silencing the warning is not good. We should actually make sure that the problem is fixed. > { > @@ -833,6 +833,7 @@ > #endif > } > > +#if defined(__linux__) || defined(__CYGWIN__) > static int > device_is_wholedisk (const char *os_dev) > { > @@ -842,6 +843,7 @@ > return 1; > return 0; > } > +#endif That's good. > static int > find_system_device (const char *os_dev) > @@ -1045,7 +1047,7 @@ > > if (strncmp ("/dev/", os_dev, 5) == 0) > { > - char *p, *q; > + const char *p, *q; > long int n; > > for (p = os_dev + 5; *p; ++p) > @@ -1055,7 +1057,7 @@ > if (p) > { > p++; > - n = strtol (p, &q, 10); > + n = strtol (p, (char **) &q, 10); Casts to remove "const" look like hacks to me. Again, it's better to keep a warning that to have such code. -- Regards, Pavel Roskin