On Wed, Jun 17, 2009 at 11:47 PM, Pavel Roskin <pro...@gnu.org> wrote:

> Hello!
>
> I have fixed the remaining warnings in the coreboot build, so now GRUB
> builds without warnings for all 7 supported platforms in the default
> configuration.  Let's keep it this way.
>
There are still warnings if you compile under FreeBSD. Attached patch fixes
all of them except one
The remaining is
util/hostdisk.c:1061: comparison between signed and unsigned
The problem comes from the following declaration
# define GRUB_LONG_MIN -2147483648UL
As you see we declare a negative number with UL. This works correctly on
i386 but what about other architectures? Can this warning be just silenced
with a cast or do we have a real problem here?
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))
     {
@@ -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

 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);
                   if (p != q && n != GRUB_LONG_MIN && n != GRUB_LONG_MAX)
                     {
                       dos_part = (int) n - 1;


-- 
Regards
Vladimir 'phcoder' Serbinenko
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to