From: Pavel Roskin <proski@gnu.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: Warning free build achieved, coreboot documentation updated
Date: Mon, 22 Jun 2009 18:49:31 -0400 [thread overview]
Message-ID: <1245710971.6595.15.camel@mj> (raw)
In-Reply-To: <d7ead6de0906171725h19b47948w88c93c6665e1254c@mail.gmail.com>
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
prev parent reply other threads:[~2009-06-22 22:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-17 21:47 Warning free build achieved, coreboot documentation updated Pavel Roskin
2009-06-18 0:25 ` Vladimir 'phcoder' Serbinenko
2009-06-18 5:00 ` Isaac Dupree
2009-06-22 22:49 ` Pavel Roskin [this message]
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=1245710971.6595.15.camel@mj \
--to=proski@gnu.org \
--cc=grub-devel@gnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.