* Freeze on 27 February
@ 2012-02-21 16:12 Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-21 16:19 ` Lennart Sorensen
2012-02-22 5:35 ` Freeze on 27 February Richard Laager
0 siblings, 2 replies; 45+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-02-21 16:12 UTC (permalink / raw)
To: The development of GRUB 2
Hello, it's to announce that from 27th of February the GRUB will be
frozen for 2.00 release. From that date on, no new features will be
committed only bugfixes.
If you have a patch which you think should be included in 2.00 you can
ping me about it but I might answer that it's postponed after 2.00
@Richard Laager: Which of ZFS patches aren't committed yet? It's a bit
tricky to see which ones were superseeded.
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Freeze on 27 February
2012-02-21 16:12 Freeze on 27 February Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-02-21 16:19 ` Lennart Sorensen
2012-02-21 17:09 ` Lists and aliasing (Re: Freeze on 27 February) Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-22 5:35 ` Freeze on 27 February Richard Laager
1 sibling, 1 reply; 45+ messages in thread
From: Lennart Sorensen @ 2012-02-21 16:19 UTC (permalink / raw)
To: The development of GNU GRUB
On Tue, Feb 21, 2012 at 05:12:12PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> Hello, it's to announce that from 27th of February the GRUB will be
> frozen for 2.00 release. From that date on, no new features will be
> committed only bugfixes.
> If you have a patch which you think should be included in 2.00 you
> can ping me about it but I might answer that it's postponed after
> 2.00
> @Richard Laager: Which of ZFS patches aren't committed yet? It's a
> bit tricky to see which ones were superseeded.
Any chance all these warnings will get fixed so powerpc can compile
without using --disable-werror?
At this point I can't figure out what to do to convince gcc that aliasing
the list structure should be allowed. It looks like the way lists are
done in grub is simply a big hack that gcc doesn't like.
--
Len Sorensen
^ permalink raw reply [flat|nested] 45+ messages in thread
* Lists and aliasing (Re: Freeze on 27 February)
2012-02-21 16:19 ` Lennart Sorensen
@ 2012-02-21 17:09 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-21 18:46 ` Lennart Sorensen
0 siblings, 1 reply; 45+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-02-21 17:09 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 961 bytes --]
On 21.02.2012 17:19, Lennart Sorensen wrote:
> On Tue, Feb 21, 2012 at 05:12:12PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>> Hello, it's to announce that from 27th of February the GRUB will be
>> frozen for 2.00 release. From that date on, no new features will be
>> committed only bugfixes.
>> If you have a patch which you think should be included in 2.00 you
>> can ping me about it but I might answer that it's postponed after
>> 2.00
>> @Richard Laager: Which of ZFS patches aren't committed yet? It's a
>> bit tricky to see which ones were superseeded.
> Any chance all these warnings will get fixed so powerpc can compile
> without using --disable-werror?
>
> At this point I can't figure out what to do to convince gcc that aliasing
> the list structure should be allowed. It looks like the way lists are
> done in grub is simply a big hack that gcc doesn't like.
>
Try attached patch
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: list.diff --]
[-- Type: text/x-diff, Size: 1383 bytes --]
=== modified file 'grub-core/kern/list.c'
--- grub-core/kern/list.c 2012-02-12 02:52:17 +0000
+++ grub-core/kern/list.c 2012-02-12 02:52:48 +0000
@@ -32,3 +32,24 @@
return NULL;
}
+
+void
+grub_list_push (grub_list_t *head, grub_list_t item)
+{
+ item->prev = head;
+ if (*head)
+ (*head)->prev = &item->next;
+ item->next = *head;
+ *head = item;
+}
+
+void
+grub_list_remove (grub_list_t item)
+{
+ if (item->prev)
+ *item->prev = item->next;
+ if (item->next)
+ item->next->prev = item->prev;
+ item->next = 0;
+ item->prev = 0;
+}
=== modified file 'include/grub/list.h'
--- include/grub/list.h 2012-02-12 02:52:17 +0000
+++ include/grub/list.h 2012-02-12 02:53:20 +0000
@@ -31,26 +31,8 @@
};
typedef struct grub_list *grub_list_t;
-static inline void
-grub_list_push (grub_list_t *head, grub_list_t item)
-{
- item->prev = head;
- if (*head)
- (*head)->prev = &item->next;
- item->next = *head;
- *head = item;
-}
-
-static inline void
-grub_list_remove (grub_list_t item)
-{
- if (item->prev)
- *item->prev = item->next;
- if (item->next)
- item->next->prev = item->prev;
- item->next = 0;
- item->prev = 0;
-}
+void EXPORT_FUNC(grub_list_push) (grub_list_t *head, grub_list_t item);
+void EXPORT_FUNC(grub_list_remove) (grub_list_t item);
#define FOR_LIST_ELEMENTS(var, list) for ((var) = (list); (var); (var) = (var)->next)
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-21 17:09 ` Lists and aliasing (Re: Freeze on 27 February) Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-02-21 18:46 ` Lennart Sorensen
2012-02-21 19:58 ` Lennart Sorensen
0 siblings, 1 reply; 45+ messages in thread
From: Lennart Sorensen @ 2012-02-21 18:46 UTC (permalink / raw)
To: The development of GNU GRUB
On Tue, Feb 21, 2012 at 06:09:36PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> Try attached patch
>
>
> --
> Regards
> Vladimir 'φ-coder/phcoder' Serbinenko
>
> === modified file 'grub-core/kern/list.c'
> --- grub-core/kern/list.c 2012-02-12 02:52:17 +0000
> +++ grub-core/kern/list.c 2012-02-12 02:52:48 +0000
> @@ -32,3 +32,24 @@
>
> return NULL;
> }
> +
> +void
> +grub_list_push (grub_list_t *head, grub_list_t item)
> +{
> + item->prev = head;
> + if (*head)
> + (*head)->prev = &item->next;
> + item->next = *head;
> + *head = item;
> +}
> +
> +void
> +grub_list_remove (grub_list_t item)
> +{
> + if (item->prev)
> + *item->prev = item->next;
> + if (item->next)
> + item->next->prev = item->prev;
> + item->next = 0;
> + item->prev = 0;
> +}
>
> === modified file 'include/grub/list.h'
> --- include/grub/list.h 2012-02-12 02:52:17 +0000
> +++ include/grub/list.h 2012-02-12 02:53:20 +0000
> @@ -31,26 +31,8 @@
> };
> typedef struct grub_list *grub_list_t;
>
> -static inline void
> -grub_list_push (grub_list_t *head, grub_list_t item)
> -{
> - item->prev = head;
> - if (*head)
> - (*head)->prev = &item->next;
> - item->next = *head;
> - *head = item;
> -}
> -
> -static inline void
> -grub_list_remove (grub_list_t item)
> -{
> - if (item->prev)
> - *item->prev = item->next;
> - if (item->next)
> - item->next->prev = item->prev;
> - item->next = 0;
> - item->prev = 0;
> -}
> +void EXPORT_FUNC(grub_list_push) (grub_list_t *head, grub_list_t item);
> +void EXPORT_FUNC(grub_list_remove) (grub_list_t item);
>
> #define FOR_LIST_ELEMENTS(var, list) for ((var) = (list); (var); (var) = (var)->next)
>
That actually seems to have done it. I am still trying to wrap my head
around why that made a difference since it appears to be identical code
moved somewhere else. It isn't inlined anymore, but should that make
a big difference?
Only 509 warnings left (down from 5000 or so).
Any patches for:
gcc-4.4 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"grub-core/lib/pbkdf2.c\" -I. -I../.. -I. -
I../.. -I../../include -I./include -I./grub-core/gnulib -I../../grub-core/gnulib -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined
-Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wigno
red-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap
-Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialize
d -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prot
otypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition -c -o grub-core/lib/libgrubkern_a-pbkdf2.o `test
-f 'grub-core/lib/pbkdf2.c' || echo '../../'`grub-core/lib/pbkdf2.c
../../grub-core/lib/pbkdf2.c: In function 'grub_crypto_pbkdf2':
../../grub-core/lib/pbkdf2.c:77: warning: cannot optimize possibly infinite loops
../../grub-core/lib/pbkdf2.c:73: warning: cannot optimize possibly infinite loops
gcc-4.4 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"grub-core/disk/ldm.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I./grub-core/gnulib -I../../grub-core/gnulib -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition -c -o grub-core/disk/libgrubkern_a-ldm.o `test -f 'grub-core/disk/ldm.c' || echo '../../'`grub-core/disk/ldm.c
../../grub-core/disk/ldm.c: In function 'grub_util_get_ldm':
../../grub-core/disk/ldm.c:834: warning: 'res' may be used uninitialized in this function
gcc-4.4 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"grub-core/commands/testload.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I../../grub-core/lib/minilzo -I../../grub-core/lib/xzembed -DMINILZO_HAVE_CONFIG_H -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -fno-builtin -Wno-undef -c -o grub-core/commands/libgrubmods_a-testload.o `test -f 'grub-core/commands/testload.c' || echo '../../'`grub-core/commands/testload.c
../../grub-core/commands/testload.c: In function 'grub_cmd_testload':
../../grub-core/commands/testload.c:99: warning: cannot optimize loop, the loop counter may overflow
../../grub-core/commands/testload.c:80: warning: cannot optimize loop, the loop counter may overflow
gcc-4.4 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"grub-core/fs/affs.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I../../grub-core/lib/minilzo -I../../grub-core/lib/xzembed -DMINILZO_HAVE_CONFIG_H -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -fno-builtin -Wno-undef -c -o grub-core/fs/libgrubmods_a-affs.o `test -f 'grub-core/fs/affs.c' || echo '../../'`grub-core/fs/affs.c
../../grub-core/fs/affs.c: In function 'grub_affs_read_block':
../../grub-core/fs/affs.c:146: warning: cannot optimize possibly infinite loops
gcc-4.4 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"grub-core/fs/cpio_be.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I../../grub-core/lib/minilzo -I../../grub-core/lib/xzembed -DMINILZO_HAVE_CONFIG_H -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -fno-builtin -Wno-undef -c -o grub-core/fs/libgrubmods_a-cpio_be.o `test -f 'grub-core/fs/cpio_be.c' || echo '../../'`grub-core/fs/cpio_be.c
In file included from ../../grub-core/fs/cpio_be.c:2:
../../grub-core/fs/cpio.c: In function 'grub_cpio_find_file':
../../grub-core/fs/cpio.c:187: warning: will never be executed
../../grub-core/fs/cpio.c:187: warning: will never be executed
../../grub-core/fs/cpio.c:187: warning: will never be executed
../../grub-core/fs/cpio.c:187: warning: will never be executed
and many more.
I can include a complete build log again if you want.
--
Len Sorensen
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-21 18:46 ` Lennart Sorensen
@ 2012-02-21 19:58 ` Lennart Sorensen
2012-02-21 20:29 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-21 21:40 ` Lennart Sorensen
0 siblings, 2 replies; 45+ messages in thread
From: Lennart Sorensen @ 2012-02-21 19:58 UTC (permalink / raw)
To: The development of GNU GRUB
On Tue, Feb 21, 2012 at 01:46:27PM -0500, Lennart Sorensen wrote:
> That actually seems to have done it. I am still trying to wrap my head
> around why that made a difference since it appears to be identical code
> moved somewhere else. It isn't inlined anymore, but should that make
> a big difference?
>
> Only 509 warnings left (down from 5000 or so).
Using gcc 4.6 drops that to 199 warnings, so gcc 4.4 is a bit more whiny
than 4.6.
--
Len Sorensen
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-21 19:58 ` Lennart Sorensen
@ 2012-02-21 20:29 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-22 15:34 ` Lennart Sorensen
2012-02-21 21:40 ` Lennart Sorensen
1 sibling, 1 reply; 45+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-02-21 20:29 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 553 bytes --]
On 21.02.2012 20:58, Lennart Sorensen wrote:
> On Tue, Feb 21, 2012 at 01:46:27PM -0500, Lennart Sorensen wrote:
>> That actually seems to have done it. I am still trying to wrap my head
>> around why that made a difference since it appears to be identical code
>> moved somewhere else. It isn't inlined anymore, but should that make
>> a big difference?
>>
>> Only 509 warnings left (down from 5000 or so).
> Using gcc 4.6 drops that to 199 warnings, so gcc 4.4 is a bit more whiny
> than 4.6.
>
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: warn.diff --]
[-- Type: text/x-diff; name="warn.diff", Size: 14280 bytes --]
diff --exclude Makefile.util.am --exclude Makefile.in --exclude grub.info --exclude configure --exclude aclocal.m4 --exclude '*autom4te.cache*' -ur mainline/configure.ac mainline-mod/configure.ac
--- mainline/configure.ac 2012-02-21 14:29:15.000000000 +0100
+++ mainline-mod/configure.ac 2012-02-21 20:18:57.327763779 +0100
@@ -377,7 +377,7 @@
LIBS=""
# debug flags.
-WARN_FLAGS="-Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
+WARN_FLAGS="-Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS"
TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes"
TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g"
diff --exclude Makefile.util.am --exclude Makefile.in --exclude grub.info --exclude configure --exclude aclocal.m4 --exclude '*autom4te.cache*' -ur mainline/grub-core/commands/testload.c mainline-mod/grub-core/commands/testload.c
--- mainline/grub-core/commands/testload.c 2012-02-08 00:13:14.000000000 +0100
+++ mainline-mod/grub-core/commands/testload.c 2012-02-21 20:57:08.003762787 +0100
@@ -100,7 +100,10 @@
{
char sector[GRUB_DISK_SECTOR_SIZE];
- pos -= GRUB_DISK_SECTOR_SIZE;
+ if (pos >= GRUB_DISK_SECTOR_SIZE)
+ pos -= GRUB_DISK_SECTOR_SIZE;
+ else
+ pos = 0;
grub_file_seek (file, pos);
diff --exclude Makefile.util.am --exclude Makefile.in --exclude grub.info --exclude configure --exclude aclocal.m4 --exclude '*autom4te.cache*' -ur mainline/grub-core/fs/affs.c mainline-mod/grub-core/fs/affs.c
--- mainline/grub-core/fs/affs.c 2012-01-29 18:28:10.000000000 +0100
+++ mainline-mod/grub-core/fs/affs.c 2012-02-21 21:05:56.271763053 +0100
@@ -143,7 +143,7 @@
mod = (grub_uint32_t) fileblock % data->htsize;
/* Find the block that points to the fileblock we are looking up by
following the chain until the right table is reached. */
- for (curblock = node->last_block_cache + 1; curblock <= target; curblock++)
+ for (curblock = node->last_block_cache + 1; curblock < target + 1; curblock++)
{
grub_disk_read (data->disk,
node->block_cache[curblock - 1] + data->blocksize - 1,
diff --exclude Makefile.util.am --exclude Makefile.in --exclude grub.info --exclude configure --exclude aclocal.m4 --exclude '*autom4te.cache*' -ur mainline/grub-core/kern/corecmd.c mainline-mod/grub-core/kern/corecmd.c
--- mainline/grub-core/kern/corecmd.c 2012-02-12 15:26:18.000000000 +0100
+++ mainline-mod/grub-core/kern/corecmd.c 2012-02-21 20:50:07.351761943 +0100
@@ -128,7 +128,7 @@
else
{
char *device_name;
- grub_device_t dev;
+ grub_device_t dev = 0;
grub_fs_t fs;
char *path;
diff --exclude Makefile.util.am --exclude Makefile.in --exclude grub.info --exclude configure --exclude aclocal.m4 --exclude '*autom4te.cache*' -ur mainline/grub-core/kern/disk.c mainline-mod/grub-core/kern/disk.c
--- mainline/grub-core/kern/disk.c 2012-02-11 18:19:04.000000000 +0100
+++ mainline-mod/grub-core/kern/disk.c 2012-02-21 19:22:18.931756689 +0100
@@ -660,7 +660,7 @@
goto finish;
sector += (1 << (disk->log_sector_size - GRUB_DISK_SECTOR_BITS));
- buf = (char *) buf + len;
+ buf = (const char *) buf + len;
size -= len;
real_offset = 0;
}
@@ -678,7 +678,7 @@
while (n--)
grub_disk_cache_invalidate (disk->dev->id, disk->id, sector++);
- buf = (char *) buf + len;
+ buf = (const char *) buf + len;
size -= len;
}
}
diff --exclude Makefile.util.am --exclude Makefile.in --exclude grub.info --exclude configure --exclude aclocal.m4 --exclude '*autom4te.cache*' -ur mainline/grub-core/kern/emu/hostdisk.c mainline-mod/grub-core/kern/emu/hostdisk.c
--- mainline/grub-core/kern/emu/hostdisk.c 2012-02-10 00:25:33.000000000 +0100
+++ mainline-mod/grub-core/kern/emu/hostdisk.c 2012-02-21 19:49:41.495760624 +0100
@@ -1145,8 +1145,9 @@
int lineno = 0;
struct stat st;
- auto void show_error (const char *msg);
- void show_error (const char *msg)
+ auto void show_error (const char *msg)
+ __attribute__ ((noreturn));
+ void __attribute__ ((noreturn)) show_error (const char *msg)
{
grub_util_error ("%s:%d: %s", dev_map, lineno, msg);
}
diff --exclude Makefile.util.am --exclude Makefile.in --exclude grub.info --exclude configure --exclude aclocal.m4 --exclude '*autom4te.cache*' -ur mainline/grub-core/kern/list.c mainline-mod/grub-core/kern/list.c
--- mainline/grub-core/kern/list.c 2012-01-24 13:19:05.000000000 +0100
+++ mainline-mod/grub-core/kern/list.c 2012-02-21 20:13:45.891763027 +0100
@@ -68,3 +68,24 @@
if (! inactive)
nitem->prio |= GRUB_PRIO_LIST_FLAG_ACTIVE;
}
+
+void
+grub_list_push (grub_list_t *head, grub_list_t item)
+{
+ item->prev = head;
+ if (*head)
+ (*head)->prev = &item->next;
+ item->next = *head;
+ *head = item;
+}
+
+void
+grub_list_remove (grub_list_t item)
+{
+ if (item->prev)
+ *item->prev = item->next;
+ if (item->next)
+ item->next->prev = item->prev;
+ item->next = 0;
+ item->prev = 0;
+}
diff --exclude Makefile.util.am --exclude Makefile.in --exclude grub.info --exclude configure --exclude aclocal.m4 --exclude '*autom4te.cache*' -ur mainline/grub-core/lib/pbkdf2.c mainline-mod/grub-core/lib/pbkdf2.c
--- mainline/grub-core/lib/pbkdf2.c 2012-02-09 15:13:25.000000000 +0100
+++ mainline-mod/grub-core/lib/pbkdf2.c 2012-02-21 21:00:08.475756929 +0100
@@ -70,13 +70,13 @@
grub_memcpy (tmp, S, Slen);
- for (i = 1; i <= l; i++)
+ for (i = 1; i - 1 < l; i++)
{
grub_memset (T, 0, hLen);
- for (u = 1; u <= c; u++)
+ for (u = 0; u < c; u++)
{
- if (u == 1)
+ if (u == 0)
{
tmp[Slen + 0] = (i & 0xff000000) >> 24;
tmp[Slen + 1] = (i & 0x00ff0000) >> 16;
diff --exclude Makefile.util.am --exclude Makefile.in --exclude grub.info --exclude configure --exclude aclocal.m4 --exclude '*autom4te.cache*' -ur mainline/grub-core/lib/xzembed/xz_dec_bcj.c mainline-mod/grub-core/lib/xzembed/xz_dec_bcj.c
--- mainline/grub-core/lib/xzembed/xz_dec_bcj.c 2010-12-01 15:45:43.000000000 +0100
+++ mainline-mod/grub-core/lib/xzembed/xz_dec_bcj.c 2012-02-21 21:10:05.895761645 +0100
@@ -168,7 +168,7 @@
size_t i;
uint32_t instr;
- for (i = 0; i + 4 <= size; i += 4) {
+ for (i = 0; i + 3 < size; i += 4) {
instr = get_unaligned_be32(buf + i);
if ((instr & 0xFC000003) == 0x48000001) {
instr &= 0x03FFFFFC;
diff --exclude Makefile.util.am --exclude Makefile.in --exclude grub.info --exclude configure --exclude aclocal.m4 --exclude '*autom4te.cache*' -ur mainline/grub-core/net/net.c mainline-mod/grub-core/net/net.c
--- mainline/grub-core/net/net.c 2012-02-21 16:15:54.000000000 +0100
+++ mainline-mod/grub-core/net/net.c 2012-02-21 20:54:22.291756835 +0100
@@ -608,8 +608,8 @@
struct grub_net_network_level_interface **interf)
{
struct grub_net_route *route;
- int depth = 0;
- int routecnt = 0;
+ unsigned depth = 0;
+ unsigned routecnt = 0;
struct grub_net_network_level_protocol *prot = NULL;
grub_net_network_level_address_t curtarget = addr;
@@ -618,7 +618,7 @@
FOR_NET_ROUTES(route)
routecnt++;
- for (depth = 0; depth < routecnt + 2; depth++)
+ for (depth = 0; depth < routecnt + 2 && depth != (unsigned) -1; depth++)
{
struct grub_net_route *bestroute = NULL;
FOR_NET_ROUTES(route)
diff --exclude Makefile.util.am --exclude Makefile.in --exclude grub.info --exclude configure --exclude aclocal.m4 --exclude '*autom4te.cache*' -ur mainline/grub-core/normal/charset.c mainline-mod/grub-core/normal/charset.c
--- mainline/grub-core/normal/charset.c 2012-02-09 22:27:51.000000000 +0100
+++ mainline-mod/grub-core/normal/charset.c 2012-02-21 21:04:33.019756480 +0100
@@ -608,7 +608,7 @@
{
struct grub_unicode_glyph t;
unsigned i, tl;
- for (i = 0; i <= (end - start) / 2; i++)
+ for (i = 0; i < (end - start) / 2 + 1; i++)
{
t = visual[start + i];
visual[start + i] = visual[end - i];
@@ -665,7 +665,7 @@
{
unsigned j;
/* FIXME: can be optimized. */
- for (j = max_level; j >= min_odd_level; j--)
+ for (j = max_level; j > min_odd_level - 1; j--)
{
unsigned in = 0;
unsigned i;
@@ -734,7 +734,7 @@
{
int right_join = 0;
signed i;
- for (i = k - 1; i >= (signed) line_start; i--)
+ for (i = k - 1; i > (signed) line_start - 1; i--)
{
enum grub_join_type join_type = get_join_type (visual[i].base);
if (!(visual[i].attributes
diff --exclude Makefile.util.am --exclude Makefile.in --exclude grub.info --exclude configure --exclude aclocal.m4 --exclude '*autom4te.cache*' -ur mainline/grub-core/normal/cmdline.c mainline-mod/grub-core/normal/cmdline.c
--- mainline/grub-core/normal/cmdline.c 2012-02-12 15:26:18.000000000 +0100
+++ mainline-mod/grub-core/normal/cmdline.c 2012-02-21 21:09:16.035762789 +0100
@@ -49,13 +49,13 @@
/* Remove the lines that don't fit in the new buffer. */
if (newsize < hist_used)
{
- int i;
- int delsize = hist_used - newsize;
+ grub_ssize_t i;
+ grub_ssize_t delsize = hist_used - newsize;
hist_used = newsize;
- for (i = 1; i <= delsize; i++)
+ for (i = 1; i < delsize + 1; i++)
{
- int pos = hist_end - i;
+ grub_ssize_t pos = hist_end - i;
if (pos < 0)
pos += hist_size;
grub_free (old_hist_lines[pos]);
diff --exclude Makefile.util.am --exclude Makefile.in --exclude grub.info --exclude configure --exclude aclocal.m4 --exclude '*autom4te.cache*' -ur mainline/include/grub/list.h mainline-mod/include/grub/list.h
--- mainline/include/grub/list.h 2012-02-21 16:15:01.000000000 +0100
+++ mainline-mod/include/grub/list.h 2012-02-21 20:13:45.891763027 +0100
@@ -31,26 +31,8 @@
};
typedef struct grub_list *grub_list_t;
-static inline void
-grub_list_push (grub_list_t *head, grub_list_t item)
-{
- item->prev = head;
- if (*head)
- (*head)->prev = &item->next;
- item->next = *head;
- *head = item;
-}
-
-static inline void
-grub_list_remove (grub_list_t item)
-{
- if (item->prev)
- *item->prev = item->next;
- if (item->next)
- item->next->prev = item->prev;
- item->next = 0;
- item->prev = 0;
-}
+void EXPORT_FUNC(grub_list_push) (grub_list_t *head, grub_list_t item);
+void EXPORT_FUNC(grub_list_remove) (grub_list_t item);
#define FOR_LIST_ELEMENTS(var, list) for ((var) = (list); (var); (var) = (var)->next)
diff --exclude Makefile.util.am --exclude Makefile.in --exclude grub.info --exclude configure --exclude aclocal.m4 --exclude '*autom4te.cache*' -ur mainline/Makefile.util.def mainline-mod/Makefile.util.def
--- mainline/Makefile.util.def 2012-02-21 18:52:37.000000000 +0100
+++ mainline-mod/Makefile.util.def 2012-02-21 20:29:09.323764500 +0100
@@ -36,7 +36,7 @@
library = {
name = libgrubmods.a;
- cflags = '$(CFLAGS_POSIX) -Wno-undef';
+ cflags = '$(CFLAGS_POSIX) -Wno-undef -Wno-error=logical-op -Wno-error=missing-noreturn';
cppflags = '-I$(top_srcdir)/grub-core/lib/minilzo -I$(srcdir)/grub-core/lib/xzembed -DMINILZO_HAVE_CONFIG_H';
common_nodist = grub_script.tab.c;
diff --exclude Makefile.util.am --exclude Makefile.in --exclude grub.info --exclude configure --exclude aclocal.m4 --exclude '*autom4te.cache*' -ur mainline/util/bin2h.c mainline-mod/util/bin2h.c
--- mainline/util/bin2h.c 2011-07-05 23:04:16.000000000 +0200
+++ mainline-mod/util/bin2h.c 2012-02-21 20:42:18.695761246 +0100
@@ -31,7 +31,7 @@
{0, 0, 0, 0 }
};
-static void
+static void __attribute__ ((noreturn))
usage (int status)
{
if (status)
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-21 19:58 ` Lennart Sorensen
2012-02-21 20:29 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-02-21 21:40 ` Lennart Sorensen
1 sibling, 0 replies; 45+ messages in thread
From: Lennart Sorensen @ 2012-02-21 21:40 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 507 bytes --]
On Tue, Feb 21, 2012 at 02:58:38PM -0500, wrote:
> Using gcc 4.6 drops that to 199 warnings, so gcc 4.4 is a bit more whiny
> than 4.6.
60% of those warnings are for three functions in argp.h not having
prototypes. After stupidly adding those prototypes (there might be a
better way to handle it than I did), the warnings with gcc 4.6 drops to
about 80.
Here is the trimmed down log of just the compile commands that had
warnings using gcc 4.6 which did not involve argp.h prototypes.
--
Len Sorensen
[-- Attachment #2: build.gcc46.warnings.log --]
[-- Type: text/plain, Size: 71232 bytes --]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"grub-core/fs/zfs/zfs_sha256.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I../../grub-core/lib/minilzo -I../../grub-core/lib/xzembed -DMINILZO_HAVE_CONFIG_H -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -fno-builtin -Wno-undef -c -o grub-core/fs/zfs/libgrubmods_a-zfs_sha256.o `test -f 'grub-core/fs/zfs/zfs_sha256.c' || echo '../../'`grub-core/fs/zfs/zfs_sha256.c
../../grub-core/fs/zfs/zfs_sha256.c: In function 'zio_checksum_SHA256':
../../grub-core/fs/zfs/zfs_sha256.c:132:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"grub-core/lib/LzmaEnc.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I../../grub-core/lib/minilzo -I../../grub-core/lib/xzembed -DMINILZO_HAVE_CONFIG_H -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -fno-builtin -Wno-undef -c -o grub-core/lib/libgrubmods_a-LzmaEnc.o `test -f 'grub-core/lib/LzmaEnc.c' || echo '../../'`grub-core/lib/LzmaEnc.c
../../grub-core/lib/LzmaEnc.c: In function 'LzmaEnc_Encode':
../../grub-core/lib/LzmaEnc.c:1214:9: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"grub-core/io/gzio.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I../../grub-core/lib/minilzo -I../../grub-core/lib/xzembed -DMINILZO_HAVE_CONFIG_H -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -fno-builtin -Wno-undef -c -o grub-core/io/libgrubmods_a-gzio.o `test -f 'grub-core/io/gzio.c' || echo '../../'`grub-core/io/gzio.c
../../grub-core/io/gzio.c: In function 'grub_gzio_read_real':
../../grub-core/io/gzio.c:716:8: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../grub-core/io/gzio.c:711:7: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../grub-core/io/gzio.c:694:8: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../grub-core/io/gzio.c:672:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"grub-core/lib/xzembed/xz_dec_bcj.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I../../grub-core/lib/minilzo -I../../grub-core/lib/xzembed -DMINILZO_HAVE_CONFIG_H -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -fno-builtin -Wno-undef -c -o grub-core/lib/xzembed/libgrubmods_a-xz_dec_bcj.o `test -f 'grub-core/lib/xzembed/xz_dec_bcj.c' || echo '../../'`grub-core/lib/xzembed/xz_dec_bcj.c
../../grub-core/lib/xzembed/xz_dec_bcj.c: In function 'bcj_powerpc.isra.0':
../../grub-core/lib/xzembed/xz_dec_bcj.c:171:2: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"grub-core/lib/libgcrypt-grub/cipher/serpent.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I../../grub-core/lib/libgcrypt_wrap -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Wno-error -Wno-missing-field-initializers -c -o grub-core/lib/libgcrypt-grub/cipher/libgrubgcry_a-serpent.o `test -f 'grub-core/lib/libgcrypt-grub/cipher/serpent.c' || echo '../../'`grub-core/lib/libgcrypt-grub/cipher/serpent.c
../../grub-core/lib/libgcrypt-grub/cipher/serpent.c: In function 'serpent_key_prepare':
../../grub-core/lib/libgcrypt-grub/cipher/serpent.c:591:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"grub-core/lib/libgcrypt-grub/cipher/rijndael.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I../../grub-core/lib/libgcrypt_wrap -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Wno-error -Wno-missing-field-initializers -c -o grub-core/lib/libgcrypt-grub/cipher/libgrubgcry_a-rijndael.o `test -f 'grub-core/lib/libgcrypt-grub/cipher/rijndael.c' || echo '../../'`grub-core/lib/libgcrypt-grub/cipher/rijndael.c
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c: In function 'do_setkey':
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:173:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c: In function 'do_encrypt_aligned':
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:324:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:324:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:347:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:371:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c: In function 'do_decrypt_aligned':
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:515:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:539:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:562:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:582:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"util/grub-mkfont.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I./grub-core/gnulib -I../../grub-core/gnulib -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition -I/usr/include/freetype2 -c -o util/grub_mkfont-grub-mkfont.o `test -f 'util/grub-mkfont.c' || echo '../../'`util/grub-mkfont.c
../../util/grub-mkfont.c: In function 'main':
../../util/grub-mkfont.c:720:7: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../../../grub-core -I.. -Wall -W -I../../../include -I../include -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -m32 -DGRUB_FILE=\"io/gzio.c\" -I. -I../../../grub-core -I.. -I../../.. -I../../../include -I../include -Os -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls -Wmissing-prototypes -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m32 -fno-stack-protector -Wno-trampolines -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1 -ffreestanding -c -o io/gzio_module-gzio.o `test -f 'io/gzio.c' || echo '../../../grub-core/'`io/gzio.c
../../../grub-core/io/gzio.c: In function 'init_dynamic_block':
../../../grub-core/io/gzio.c:918:4: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:931:4: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:946:4: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:888:7: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:876:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:873:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:870:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c: In function 'grub_gzio_read_real':
../../../grub-core/io/gzio.c:716:8: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:711:7: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:694:8: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:672:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:788:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:785:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:1009:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../../../grub-core -I.. -Wall -W -I../../../include -I../include -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -m32 -DGRUB_FILE=\"normal/cmdline.c\" -I. -I../../../grub-core -I.. -I../../.. -I../../../include -I../include -I../../../grub-core/lib/posix_wrap -Os -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls -Wmissing-prototypes -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m32 -fno-stack-protector -Wno-trampolines -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1 -ffreestanding -fno-builtin -Wno-redundant-decls -c -o normal/normal_module-cmdline.o `test -f 'normal/cmdline.c' || echo '../../../grub-core/'`normal/cmdline.c
../../../grub-core/normal/cmdline.c: In function 'grub_set_history':
../../../grub-core/normal/cmdline.c:56:4: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../../../grub-core -I.. -Wall -W -I../../../include -I../include -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -m32 -DGRUB_FILE=\"normal/charset.c\" -I. -I../../../grub-core -I.. -I../../.. -I../../../include -I../include -I../../../grub-core/lib/posix_wrap -Os -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls -Wmissing-prototypes -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m32 -fno-stack-protector -Wno-trampolines -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1 -ffreestanding -fno-builtin -Wno-redundant-decls -c -o normal/normal_module-charset.o `test -f 'normal/charset.c' || echo '../../../grub-core/'`normal/charset.c
../../../grub-core/normal/charset.c: In function 'grub_bidi_line_logical_to_visual':
../../../grub-core/normal/charset.c:737:6: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
../../../grub-core/normal/charset.c:611:5: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
../../../grub-core/normal/charset.c:668:6: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../../../grub-core -I.. -Wall -W -I../../../include -I../include -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -m32 -DGRUB_FILE=\"commands/legacycfg.c\" -I. -I../../../grub-core -I.. -I../../.. -I../../../include -I../include -Os -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls -Wmissing-prototypes -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m32 -fno-stack-protector -Wno-trampolines -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1 -ffreestanding -c -o commands/legacycfg_module-legacycfg.o `test -f 'commands/legacycfg.c' || echo '../../../grub-core/'`commands/legacycfg.c
../../../grub-core/commands/legacycfg.c: In function 'check_password_md5_real':
../../../grub-core/commands/legacycfg.c:567:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../../../grub-core -I.. -Wall -W -I../../../include -I../include -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -m32 -DGRUB_FILE=\"lib/xzembed/xz_dec_bcj.c\" -I. -I../../../grub-core -I.. -I../../.. -I../../../include -I../include -I../../../grub-core/lib/posix_wrap -I../../../grub-core/lib/xzembed -Os -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls -Wmissing-prototypes -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m32 -fno-stack-protector -Wno-trampolines -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1 -ffreestanding -Wno-unreachable-code -c -o lib/xzembed/xzio_module-xz_dec_bcj.o `test -f 'lib/xzembed/xz_dec_bcj.c' || echo '../../../grub-core/'`lib/xzembed/xz_dec_bcj.c
../../../grub-core/lib/xzembed/xz_dec_bcj.c: In function 'bcj_powerpc.isra.0':
../../../grub-core/lib/xzembed/xz_dec_bcj.c:171:2: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../../../grub-core -I.. -Wall -W -I../../../include -I../include -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -m32 -DGRUB_FILE=\"lib/libgcrypt-grub/cipher/serpent.c\" -I. -I../../../grub-core -I.. -I../../.. -I../../../include -I../include -I../../../grub-core/lib/libgcrypt_wrap -Os -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls -Wmissing-prototypes -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m32 -fno-stack-protector -Wno-trampolines -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1 -ffreestanding -Wno-error -Wno-missing-field-initializers -c -o lib/libgcrypt-grub/cipher/gcry_serpent_module-serpent.o `test -f 'lib/libgcrypt-grub/cipher/serpent.c' || echo '../../../grub-core/'`lib/libgcrypt-grub/cipher/serpent.c
../../../grub-core/lib/libgcrypt-grub/cipher/serpent.c: In function 'serpent_key_prepare':
../../../grub-core/lib/libgcrypt-grub/cipher/serpent.c:591:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../../../grub-core -I.. -Wall -W -I../../../include -I../include -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -m32 -DGRUB_FILE=\"lib/libgcrypt-grub/cipher/rijndael.c\" -I. -I../../../grub-core -I.. -I../../.. -I../../../include -I../include -I../../../grub-core/lib/libgcrypt_wrap -Os -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls -Wmissing-prototypes -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m32 -fno-stack-protector -Wno-trampolines -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1 -ffreestanding -Wno-error -Wno-missing-field-initializers -Wno-cast-align -Wno-strict-aliasing -c -o lib/libgcrypt-grub/cipher/gcry_rijndael_module-rijndael.o `test -f 'lib/libgcrypt-grub/cipher/rijndael.c' || echo '../../../grub-core/'`lib/libgcrypt-grub/cipher/rijndael.c
../../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c: In function 'do_setkey':
../../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:173:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../../../grub-core -I.. -Wall -W -I../../../include -I../include -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -m32 -DGRUB_FILE=\"kern/corecmd.c\" -I. -I../../../grub-core -I.. -I../../.. -I../../../include -I../include -I../grub-core/gnulib -I../../../grub-core/gnulib -Os -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls -Wmissing-prototypes -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m32 -fno-stack-protector -Wno-trampolines -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1 -ffreestanding -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition -c -o kern/kernel_exec-corecmd.o `test -f 'kern/corecmd.c' || echo '../../../grub-core/'`kern/corecmd.c
../../../grub-core/kern/corecmd.c: In function 'grub_core_cmd_ls':
../../../grub-core/kern/corecmd.c:171:10: warning: 'dev' may be used uninitialized in this function [-Wuninitialized]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_IEEE1275=1 -DGRUB_MACHINE=POWERPC_IEEE1275 -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"grub-core/fs/zfs/zfs_sha256.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I../../grub-core/lib/minilzo -I../../grub-core/lib/xzembed -DMINILZO_HAVE_CONFIG_H -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -fno-builtin -Wno-undef -c -o grub-core/fs/zfs/libgrubmods_a-zfs_sha256.o `test -f 'grub-core/fs/zfs/zfs_sha256.c' || echo '../../'`grub-core/fs/zfs/zfs_sha256.c
../../grub-core/fs/zfs/zfs_sha256.c: In function 'zio_checksum_SHA256':
../../grub-core/fs/zfs/zfs_sha256.c:132:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_IEEE1275=1 -DGRUB_MACHINE=POWERPC_IEEE1275 -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"grub-core/lib/LzmaEnc.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I../../grub-core/lib/minilzo -I../../grub-core/lib/xzembed -DMINILZO_HAVE_CONFIG_H -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -fno-builtin -Wno-undef -c -o grub-core/lib/libgrubmods_a-LzmaEnc.o `test -f 'grub-core/lib/LzmaEnc.c' || echo '../../'`grub-core/lib/LzmaEnc.c
../../grub-core/lib/LzmaEnc.c: In function 'LzmaEnc_Encode':
../../grub-core/lib/LzmaEnc.c:1214:9: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_IEEE1275=1 -DGRUB_MACHINE=POWERPC_IEEE1275 -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"grub-core/io/gzio.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I../../grub-core/lib/minilzo -I../../grub-core/lib/xzembed -DMINILZO_HAVE_CONFIG_H -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -fno-builtin -Wno-undef -c -o grub-core/io/libgrubmods_a-gzio.o `test -f 'grub-core/io/gzio.c' || echo '../../'`grub-core/io/gzio.c
../../grub-core/io/gzio.c: In function 'grub_gzio_read_real':
../../grub-core/io/gzio.c:716:8: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../grub-core/io/gzio.c:711:7: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../grub-core/io/gzio.c:694:8: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../grub-core/io/gzio.c:672:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_IEEE1275=1 -DGRUB_MACHINE=POWERPC_IEEE1275 -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"grub-core/lib/xzembed/xz_dec_bcj.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I../../grub-core/lib/minilzo -I../../grub-core/lib/xzembed -DMINILZO_HAVE_CONFIG_H -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -fno-builtin -Wno-undef -c -o grub-core/lib/xzembed/libgrubmods_a-xz_dec_bcj.o `test -f 'grub-core/lib/xzembed/xz_dec_bcj.c' || echo '../../'`grub-core/lib/xzembed/xz_dec_bcj.c
../../grub-core/lib/xzembed/xz_dec_bcj.c: In function 'bcj_powerpc.isra.0':
../../grub-core/lib/xzembed/xz_dec_bcj.c:171:2: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_IEEE1275=1 -DGRUB_MACHINE=POWERPC_IEEE1275 -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"grub-core/lib/libgcrypt-grub/cipher/serpent.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I../../grub-core/lib/libgcrypt_wrap -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Wno-error -Wno-missing-field-initializers -c -o grub-core/lib/libgcrypt-grub/cipher/libgrubgcry_a-serpent.o `test -f 'grub-core/lib/libgcrypt-grub/cipher/serpent.c' || echo '../../'`grub-core/lib/libgcrypt-grub/cipher/serpent.c
../../grub-core/lib/libgcrypt-grub/cipher/serpent.c: In function 'serpent_key_prepare':
../../grub-core/lib/libgcrypt-grub/cipher/serpent.c:591:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_IEEE1275=1 -DGRUB_MACHINE=POWERPC_IEEE1275 -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"grub-core/lib/libgcrypt-grub/cipher/rijndael.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I../../grub-core/lib/libgcrypt_wrap -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Wno-error -Wno-missing-field-initializers -c -o grub-core/lib/libgcrypt-grub/cipher/libgrubgcry_a-rijndael.o `test -f 'grub-core/lib/libgcrypt-grub/cipher/rijndael.c' || echo '../../'`grub-core/lib/libgcrypt-grub/cipher/rijndael.c
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c: In function 'do_setkey':
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:173:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c: In function 'do_encrypt_aligned':
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:324:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:324:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:347:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:371:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c: In function 'do_decrypt_aligned':
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:515:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:539:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:562:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:582:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_IEEE1275=1 -DGRUB_MACHINE=POWERPC_IEEE1275 -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"util/grub-mkfont.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I./grub-core/gnulib -I../../grub-core/gnulib -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition -I/usr/include/freetype2 -c -o util/grub_mkfont-grub-mkfont.o `test -f 'util/grub-mkfont.c' || echo '../../'`util/grub-mkfont.c
../../util/grub-mkfont.c: In function 'main':
../../util/grub-mkfont.c:720:7: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../../../grub-core -I.. -Wall -W -I../../../include -I../include -DGRUB_MACHINE_IEEE1275=1 -DGRUB_MACHINE=POWERPC_IEEE1275 -DGRUB_TARGET_CPU_POWERPC=1 -m32 -nostdinc -isystem /usr/lib/gcc/powerpc-linux-gnu/4.6/include -DGRUB_FILE=\"io/gzio.c\" -I. -I../../../grub-core -I.. -I../../.. -I../../../include -I../include -Os -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls -Wmissing-prototypes -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m32 -fno-stack-protector -Wno-trampolines -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1 -ffreestanding -c -o io/gzio_module-gzio.o `test -f 'io/gzio.c' || echo '../../../grub-core/'`io/gzio.c
../../../grub-core/io/gzio.c: In function 'init_dynamic_block':
../../../grub-core/io/gzio.c:918:4: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:931:4: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:946:4: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:888:7: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:876:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:873:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:870:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c: In function 'grub_gzio_read_real':
../../../grub-core/io/gzio.c:716:8: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:711:7: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:694:8: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:672:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:788:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:785:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:1009:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../../../grub-core -I.. -Wall -W -I../../../include -I../include -DGRUB_MACHINE_IEEE1275=1 -DGRUB_MACHINE=POWERPC_IEEE1275 -DGRUB_TARGET_CPU_POWERPC=1 -m32 -nostdinc -isystem /usr/lib/gcc/powerpc-linux-gnu/4.6/include -DGRUB_FILE=\"normal/cmdline.c\" -I. -I../../../grub-core -I.. -I../../.. -I../../../include -I../include -I../../../grub-core/lib/posix_wrap -Os -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls -Wmissing-prototypes -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m32 -fno-stack-protector -Wno-trampolines -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1 -ffreestanding -fno-builtin -Wno-redundant-decls -c -o normal/normal_module-cmdline.o `test -f 'normal/cmdline.c' || echo '../../../grub-core/'`normal/cmdline.c
../../../grub-core/normal/cmdline.c: In function 'grub_set_history':
../../../grub-core/normal/cmdline.c:56:4: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../../../grub-core -I.. -Wall -W -I../../../include -I../include -DGRUB_MACHINE_IEEE1275=1 -DGRUB_MACHINE=POWERPC_IEEE1275 -DGRUB_TARGET_CPU_POWERPC=1 -m32 -nostdinc -isystem /usr/lib/gcc/powerpc-linux-gnu/4.6/include -DGRUB_FILE=\"normal/charset.c\" -I. -I../../../grub-core -I.. -I../../.. -I../../../include -I../include -I../../../grub-core/lib/posix_wrap -Os -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls -Wmissing-prototypes -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m32 -fno-stack-protector -Wno-trampolines -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1 -ffreestanding -fno-builtin -Wno-redundant-decls -c -o normal/normal_module-charset.o `test -f 'normal/charset.c' || echo '../../../grub-core/'`normal/charset.c
../../../grub-core/normal/charset.c: In function 'grub_bidi_line_logical_to_visual':
../../../grub-core/normal/charset.c:737:6: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
../../../grub-core/normal/charset.c:611:5: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
../../../grub-core/normal/charset.c:668:6: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../../../grub-core -I.. -Wall -W -I../../../include -I../include -DGRUB_MACHINE_IEEE1275=1 -DGRUB_MACHINE=POWERPC_IEEE1275 -DGRUB_TARGET_CPU_POWERPC=1 -m32 -nostdinc -isystem /usr/lib/gcc/powerpc-linux-gnu/4.6/include -DGRUB_FILE=\"lib/xzembed/xz_dec_bcj.c\" -I. -I../../../grub-core -I.. -I../../.. -I../../../include -I../include -I../../../grub-core/lib/posix_wrap -I../../../grub-core/lib/xzembed -Os -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls -Wmissing-prototypes -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m32 -fno-stack-protector -Wno-trampolines -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1 -ffreestanding -Wno-unreachable-code -c -o lib/xzembed/xzio_module-xz_dec_bcj.o `test -f 'lib/xzembed/xz_dec_bcj.c' || echo '../../../grub-core/'`lib/xzembed/xz_dec_bcj.c
../../../grub-core/lib/xzembed/xz_dec_bcj.c: In function 'bcj_powerpc.isra.0':
../../../grub-core/lib/xzembed/xz_dec_bcj.c:171:2: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../../../grub-core -I.. -Wall -W -I../../../include -I../include -DGRUB_MACHINE_IEEE1275=1 -DGRUB_MACHINE=POWERPC_IEEE1275 -DGRUB_TARGET_CPU_POWERPC=1 -m32 -nostdinc -isystem /usr/lib/gcc/powerpc-linux-gnu/4.6/include -DGRUB_FILE=\"lib/libgcrypt-grub/cipher/serpent.c\" -I. -I../../../grub-core -I.. -I../../.. -I../../../include -I../include -I../../../grub-core/lib/libgcrypt_wrap -Os -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls -Wmissing-prototypes -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m32 -fno-stack-protector -Wno-trampolines -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1 -ffreestanding -Wno-error -Wno-missing-field-initializers -c -o lib/libgcrypt-grub/cipher/gcry_serpent_module-serpent.o `test -f 'lib/libgcrypt-grub/cipher/serpent.c' || echo '../../../grub-core/'`lib/libgcrypt-grub/cipher/serpent.c
../../../grub-core/lib/libgcrypt-grub/cipher/serpent.c: In function 'serpent_key_prepare':
../../../grub-core/lib/libgcrypt-grub/cipher/serpent.c:591:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../../../grub-core -I.. -Wall -W -I../../../include -I../include -DGRUB_MACHINE_IEEE1275=1 -DGRUB_MACHINE=POWERPC_IEEE1275 -DGRUB_TARGET_CPU_POWERPC=1 -m32 -nostdinc -isystem /usr/lib/gcc/powerpc-linux-gnu/4.6/include -DGRUB_FILE=\"lib/libgcrypt-grub/cipher/rijndael.c\" -I. -I../../../grub-core -I.. -I../../.. -I../../../include -I../include -I../../../grub-core/lib/libgcrypt_wrap -Os -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls -Wmissing-prototypes -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m32 -fno-stack-protector -Wno-trampolines -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1 -ffreestanding -Wno-error -Wno-missing-field-initializers -Wno-cast-align -Wno-strict-aliasing -c -o lib/libgcrypt-grub/cipher/gcry_rijndael_module-rijndael.o `test -f 'lib/libgcrypt-grub/cipher/rijndael.c' || echo '../../../grub-core/'`lib/libgcrypt-grub/cipher/rijndael.c
../../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c: In function 'do_setkey':
../../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:173:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
gcc-4.6 -DHAVE_CONFIG_H -I. -I../../../grub-core -I.. -Wall -W -I../../../include -I../include -DGRUB_MACHINE_IEEE1275=1 -DGRUB_MACHINE=POWERPC_IEEE1275 -DGRUB_TARGET_CPU_POWERPC=1 -m32 -nostdinc -isystem /usr/lib/gcc/powerpc-linux-gnu/4.6/include -DGRUB_FILE=\"kern/corecmd.c\" -I. -I../../../grub-core -I.. -I../../.. -I../../../include -I../include -Os -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls -Wmissing-prototypes -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m32 -fno-stack-protector -Wno-trampolines -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1 -ffreestanding -c -o kern/kernel_exec-corecmd.o `test -f 'kern/corecmd.c' || echo '../../../grub-core/'`kern/corecmd.c
../../../grub-core/kern/corecmd.c: In function 'grub_core_cmd_ls':
../../../grub-core/kern/corecmd.c:171:10: warning: 'dev' may be used uninitialized in this function [-Wuninitialized]
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Freeze on 27 February
2012-02-21 16:12 Freeze on 27 February Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-21 16:19 ` Lennart Sorensen
@ 2012-02-22 5:35 ` Richard Laager
2012-02-23 6:34 ` Vladimir 'φ-coder/phcoder' Serbinenko
1 sibling, 1 reply; 45+ messages in thread
From: Richard Laager @ 2012-02-22 5:35 UTC (permalink / raw)
To: Vladimir 'φ-coder/phcoder' Serbinenko
Cc: The development of GRUB 2
[-- Attachment #1.1: Type: text/plain, Size: 2084 bytes --]
On Tue, 2012-02-21 at 17:12 +0100, Vladimir 'φ-coder/phcoder' Serbinenko
wrote:
> @Richard Laager: Which of ZFS patches aren't committed yet? It's a bit
> tricky to see which ones were superseeded.
I've attached my current patch set. The patches apply in the order
listed. They're also roughly ordered by complexity, so I'd recommend
reviewing them in this order.
Also, if you have libzfs, a --disable-zfs or --without-zfs or similar
patch is necessary to ensure that the zpool and zfs commands are used
instead of libzfs.
---- Not ZFS Related:
Previously submitted, no feedback, trivial:
grub-install-whitespace.patch
Not previously submitted, trivial:
bzrignore-updates.patch
---- ZFS Related:
Previously submitted, no feedback:
zfs-poolname-spaces.patch
zfs-devices.patch
Not previously submitted:
zfs-on-linux-rlaager8.patch
With this, you should be able to boot with (native)
ZFS-on-Linux, though you'll have to add whatever rpool
specifiers (if any) required by your initrd.
zfs-on-linux-rlaager9.patch
Part of this is just to support ZFS roots
(root=ZFS=rpool/ROOT/ubuntu, for example).
The other part may need more design work. It moves some
of the btrfs code to inside linux_entry (and likewise,
the ZFS support is added there). Right now, GRUB
supports the concept of multiple kernels. I think that
needs to be extended to multiple root filesystems (in
practice: subvols in btrfs, clones in ZFS). This is the
first step in that process. The missing part is looping
over the additional root filesystems.
Even if we can't get the multiple root filesystems issue figured out,
I'd really love to see everything else make it into the release. It'd be
a huge step in the right direction for those of us working with native
ZFS-on-Linux.
--
Richard
[-- Attachment #1.2: grub-install-whitespace.patch --]
[-- Type: text/x-patch, Size: 1276 bytes --]
Index: grub/ChangeLog.grub-install-whitespace
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ grub/ChangeLog.grub-install-whitespace 2012-02-03 05:52:51.439942000 -0600
@@ -0,0 +1,4 @@
+2012-02-03 Richard Laager <rlaager@wiktel.com>
+
+ * util/grub-install.in: Fix some inconsistent whitespace.
+
Index: grub/util/grub-install.in
===================================================================
--- grub.orig/util/grub-install.in 2012-02-03 05:53:36.039465769 -0600
+++ grub/util/grub-install.in 2012-02-03 05:54:04.771697000 -0600
@@ -486,13 +486,13 @@
# filesystem will be accessible).
partmap_module=
for x in `echo "${grub_device}" | xargs "$grub_probe" --device-map="${device_map}" --target=partmap --device 2> /dev/null`; do
- case "$x" in
- netbsd | openbsd)
- partmap_module="$partmap_module part_bsd";;
- "") ;;
- *)
- partmap_module="$partmap_module part_$x";;
- esac
+ case "$x" in
+ netbsd | openbsd)
+ partmap_module="$partmap_module part_bsd";;
+ "") ;;
+ *)
+ partmap_module="$partmap_module part_$x";;
+ esac
done
# Device abstraction module, if any (lvm, raid).
[-- Attachment #1.3: bzrignore-updates.patch --]
[-- Type: text/x-patch, Size: 633 bytes --]
=== modified file '.bzrignore'
Index: grub/.bzrignore
===================================================================
--- grub.orig/.bzrignore 2012-02-04 17:30:15.295629000 -0600
+++ grub/.bzrignore 2012-02-04 17:30:49.356454000 -0600
@@ -104,6 +104,8 @@ partmap_test
*.pp
po/*.mo
po/grub.pot
+po/POTFILES
+po/stamp-po
stamp-h
stamp-h1
stamp-h.in
@@ -132,8 +134,10 @@ contrib
grub-core/Makefile.core.am
grub-core/Makefile.gcry.def
grub-core/contrib
+grub-core/gdb_grub
grub-core/genmod.sh
grub-core/gensyminfo.sh
+grub-core/gmodule.pl
grub-core/modinfo.sh
grub-core/*.module
grub-core/*.pp
[-- Attachment #1.4: zfs-poolname-spaces.patch --]
[-- Type: text/x-patch, Size: 1099 bytes --]
Handle pool names with spaces
Index: grub/util/getroot.c
===================================================================
--- grub.orig/util/getroot.c 2012-02-03 05:21:06.838056692 -0600
+++ grub/util/getroot.c 2012-02-03 05:22:36.227364000 -0600
@@ -260,7 +260,7 @@
char cksum[257], notes[257];
unsigned int dummy;
- cmd = xasprintf ("zpool status %s", poolname);
+ cmd = xasprintf ("zpool status \"%s\"", poolname);
fp = popen (cmd, "r");
free (cmd);
@@ -285,8 +285,7 @@
st++;
break;
case 1:
- if (!strcmp (name, poolname))
- st++;
+ st++;
break;
case 2:
if (strcmp (name, "mirror") && !sscanf (name, "mirror-%u", &dummy)
@@ -420,6 +419,9 @@
if (sscanf (sep, "%s %s", entry.fstype, entry.device) != 2)
continue;
+ unescape (entry.fstype);
+ unescape (entry.device);
+
/* Using the mount IDs, find out where this fits in the list of
visible mount entries we've seen so far. There are three
interesting cases. Firstly, it may be inserted at the end: this is
[-- Attachment #1.5: zfs-devices.patch --]
[-- Type: text/x-patch, Size: 593 bytes --]
Handle vdevs with full paths
Index: grub/util/getroot.c
===================================================================
--- grub.orig/util/getroot.c 2012-02-03 05:22:36.227364000 -0600
+++ grub/util/getroot.c 2012-02-03 05:22:41.255135000 -0600
@@ -301,7 +301,10 @@
devices = xrealloc (devices, sizeof (devices[0])
* devices_allocated);
}
- devices[ndevices++] = xasprintf ("/dev/%s", name);
+ if (name[0] == '/')
+ devices[ndevices++] = xstrdup (name);
+ else
+ devices[ndevices++] = xasprintf ("/dev/%s", name);
}
break;
}
[-- Attachment #1.6: zfs-on-linux-rlaager8.patch --]
[-- Type: text/x-patch, Size: 3147 bytes --]
ZFS on Linux Improvements
1. `zpool status` can output disk names which are under /dev/disk.
2. `zpool status` outputs the whole disk device for wholedisk pools,
but GRUB needs the partition device.
3. Support native ZFS on Linux.
Index: grub/util/getroot.c
===================================================================
--- grub.orig/util/getroot.c 2012-02-03 05:54:39.540539000 -0600
+++ grub/util/getroot.c 2012-02-03 06:04:29.465275000 -0600
@@ -304,7 +304,87 @@
if (name[0] == '/')
devices[ndevices++] = xstrdup (name);
else
+#ifdef __linux__
+ {
+ /* The name returned by zpool isn't necessarily directly under /dev. */
+ char *device = xasprintf ("/dev/%s", name);
+ struct stat sb;
+ char *real_device;
+ char *c;
+ char *partition;
+
+ if (stat (device, &sb) != 0)
+ {
+ DIR *dev;
+ struct dirent *subdir;
+
+ free (device);
+ device = NULL;
+ dev = opendir ("/dev/disk");
+ if (dev)
+ {
+ while ((subdir = readdir (dev)))
+ {
+ if (subdir->d_name[0] == '.')
+ continue;
+ if (subdir->d_type == DT_UNKNOWN)
+ {
+ char *subdir_path = xasprintf ("/dev/disk/%s", subdir->d_name);
+ ret = stat (subdir_path, &sb);
+ free (subdir_path);
+ if (ret != 0)
+ continue;
+ if (!S_ISDIR (sb.st_mode))
+ continue;
+ }
+ else if (subdir->d_type != DT_DIR)
+ continue;
+ device = xasprintf ("/dev/disk/%s/%s", subdir->d_name, name);
+ if (stat (device, &sb) == 0)
+ break;
+ else
+ {
+ free (device);
+ device = NULL;
+ }
+ }
+ closedir (dev);
+ if (! device)
+ grub_util_error (_("failed to find device %s"), device);
+ }
+ }
+
+ /* Resolve the symlink to something like /dev/sda. */
+ real_device = canonicalize_file_name (device);
+ if (! real_device)
+ grub_util_error (_("failed to get canonical path of %s"), device);
+ free(device);
+
+ /* It ends in a number; assume it's a partition and stop. */
+ for (c = real_device ; *(c+1) ; c++);
+ if (*c >= '0' && *c <= '9')
+ {
+ devices[ndevices++] = real_device;
+ break;
+ }
+
+ /* Otherwise, it might be a partitioned wholedisk device. */
+ partition = xasprintf ("%s1", real_device);
+ if (stat (partition, &sb) == 0)
+ {
+ free (real_device);
+ devices[ndevices++] = partition;
+ break;
+ }
+ free (partition);
+
+ /* The device is not partitioned. */
+ devices[ndevices++] = real_device;
+ break;
+ }
+#else
devices[ndevices++] = xasprintf ("/dev/%s", name);
+#endif
}
break;
}
@@ -478,7 +558,8 @@
if (!*entries[i].device)
continue;
- if (grub_strcmp (entries[i].fstype, "fuse.zfs") == 0)
+ if (grub_strcmp (entries[i].fstype, "fuse.zfs") == 0 ||
+ grub_strcmp (entries[i].fstype, "zfs") == 0)
{
char *slash;
slash = strchr (entries[i].device, '/');
[-- Attachment #1.7: zfs-on-linux-rlaager9.patch --]
[-- Type: text/x-patch, Size: 2323 bytes --]
Pass boot=zfs and zfs-bootfs=... when / is ZFS on Linux
Index: grub/util/grub.d/10_linux.in
===================================================================
--- grub.orig/util/grub.d/10_linux.in 2012-02-02 03:34:48.512644650 -0600
+++ grub/util/grub.d/10_linux.in 2012-02-03 01:12:57.608355000 -0600
@@ -56,13 +56,11 @@
LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
fi
-if [ "x`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`" = xbtrfs ] \
- || [ "x`stat -f --printf=%T /`" = xbtrfs ]; then
- rootsubvol="`make_system_path_relative_to_its_root /`"
- rootsubvol="${rootsubvol#/}"
- if [ "x${rootsubvol}" != x ]; then
- GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
- fi
+LINUX_ROOT_FS=`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`
+LINUX_ROOT_STAT=`stat -f --printf=%T / || true`
+
+if [ "x${LINUX_ROOT_FS}" = xzfs ]; then
+ RPOOL=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true`
fi
for word in $GRUB_CMDLINE_LINUX_DEFAULT; do
@@ -193,6 +191,19 @@
version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
alt_version=`echo $version | sed -e "s,\.old$,,g"`
linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
+ cmdline=""
+ if [ "x${LINUX_ROOT_FS}" = xbtrfs -o "x${LINUX_ROOT_STAT}" = xbtrfs ]; then
+ rootsubvol="`make_system_path_relative_to_its_root /`"
+ rootsubvol="${rootsubvol#/}"
+ if [ "x${rootsubvol}" != x ]; then
+ cmdline="rootflags=subvol=${rootsubvol} ${cmdline}"
+ fi
+ fi
+ if [ "x${LINUX_ROOT_FS}" = xzfs ]; then
+ bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`"
+ linux_root_device_thisversion="ZFS=${RPOOL}${bootfs}"
+ cmdline="boot=zfs rpool=${RPOOL} bootfs=${RPOOL}${bootfs} ${cmdline}"
+ fi
initrd=
for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \
@@ -229,7 +240,7 @@
fi
linux_entry "${OS}" "${version}" false \
- "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_EXTRA} ${GRUB_CMDLINE_LINUX_DEFAULT}" \
+ "${cmdline} ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_EXTRA} ${GRUB_CMDLINE_LINUX_DEFAULT}" \
quiet
if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
if [ -x /lib/recovery-mode/recovery-menu ]; then
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-21 20:29 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-02-22 15:34 ` Lennart Sorensen
2012-02-22 15:50 ` Lennart Sorensen
0 siblings, 1 reply; 45+ messages in thread
From: Lennart Sorensen @ 2012-02-22 15:34 UTC (permalink / raw)
To: The development of GNU GRUB
On Tue, Feb 21, 2012 at 09:29:08PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> diff --exclude Makefile.util.am --exclude Makefile.in --exclude grub.info --exclude configure --exclude aclocal.m4 --exclude '*autom4te.cache*' -ur mainline/configure.ac mainline-mod/configure.ac
> --- mainline/configure.ac 2012-02-21 14:29:15.000000000 +0100
> +++ mainline-mod/configure.ac 2012-02-21 20:18:57.327763779 +0100
> @@ -377,7 +377,7 @@
> LIBS=""
>
> # debug flags.
> -WARN_FLAGS="-Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
> +WARN_FLAGS="-Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
> HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS"
> TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes"
> TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g"
> diff --exclude Makefile.util.am --exclude Makefile.in --exclude grub.info --exclude configure --exclude aclocal.m4 --exclude '*autom4te.cache*' -ur mainline/grub-core/commands/testload.c mainline-mod/grub-core/commands/testload.c
> --- mainline/grub-core/commands/testload.c 2012-02-08 00:13:14.000000000 +0100
> +++ mainline-mod/grub-core/commands/testload.c 2012-02-21 20:57:08.003762787 +0100
> @@ -100,7 +100,10 @@
> {
> char sector[GRUB_DISK_SECTOR_SIZE];
>
> - pos -= GRUB_DISK_SECTOR_SIZE;
> + if (pos >= GRUB_DISK_SECTOR_SIZE)
> + pos -= GRUB_DISK_SECTOR_SIZE;
[snip]
OK, still seeing things like:
gcc-4.4 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"grub-core/disk/ldm.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I./grub-core/gnulib -I../../grub-core/gnulib -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Werror -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition -c -o grub-core/disk/libgrubkern_a-ldm.o `test -f 'grub-core/disk/ldm.c' || echo '../../'`grub-core/disk/ldm.c
cc1: warnings being treated as errors
../../grub-core/disk/ldm.c: In function 'grub_util_get_ldm':
../../grub-core/disk/ldm.c:834: error: 'res' may be used uninitialized in this function
I will do a build with werror disabled to grab any remaining warnings.
--
Len Sorensen
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-22 15:34 ` Lennart Sorensen
@ 2012-02-22 15:50 ` Lennart Sorensen
2012-02-22 15:57 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 45+ messages in thread
From: Lennart Sorensen @ 2012-02-22 15:50 UTC (permalink / raw)
To: The development of GNU GRUB
On Wed, Feb 22, 2012 at 10:34:18AM -0500, Lennart Sorensen wrote:
> OK, still seeing things like:
>
> gcc-4.4 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"grub-core/disk/ldm.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I./grub-core/gnulib -I../../grub-core/gnulib -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initialize
> rs -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Werror -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition -c -o grub-core/disk/libgrubkern_a-ldm.o `test -f 'grub-core/disk/ldm.c' || echo '../../'`grub-core/disk/ldm.c
> cc1: warnings being treated as errors
> ../../grub-core/disk/ldm.c: In function 'grub_util_get_ldm':
> ../../grub-core/disk/ldm.c:834: error: 'res' may be used uninitialized in this function
>
> I will do a build with werror disabled to grab any remaining warnings.
So with this patch, gcc 4.4 is down to 201 warnings, and gcc 4.6 has 175.
102 of those warnings are about missing prototypes for argp_usage
_option_is_short and _option_is_end in argp.h which leaves 99 warnings
for gcc 4.4 and 73 for gcc 4.6.
A short summary of what is left is:
gcc 4.6:
../../grub-core/disk/ldm.c:858:10: warning: 'res' may be used uninitialized in this function [-Wuninitialized]
../../grub-core/fs/zfs/zfs_sha256.c:132:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../grub-core/lib/LzmaEnc.c:1214:9: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
../../grub-core/io/gzio.c:716:8: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../grub-core/io/gzio.c:711:7: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../grub-core/io/gzio.c:694:8: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../grub-core/io/gzio.c:672:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../grub-core/lib/libgcrypt-grub/cipher/serpent.c:591:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:173:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:324:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:324:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:347:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:371:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:515:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:539:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:562:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:582:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../util/grub-mkfont.c:720:7: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:918:4: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:931:4: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:946:4: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:888:7: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:876:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:873:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:870:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:716:8: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:711:7: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:694:8: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:672:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:788:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:785:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:1009:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/normal/cmdline.c:56:4: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
../../../grub-core/normal/charset.c:737:6: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
../../../grub-core/commands/legacycfg.c:567:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/lib/libgcrypt-grub/cipher/serpent.c:591:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
../../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:173:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
../../grub-core/disk/ldm.c:858:10: warning: 'res' may be used uninitialized in this function [-Wuninitialized]
../../grub-core/fs/zfs/zfs_sha256.c:132:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../grub-core/lib/LzmaEnc.c:1214:9: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
../../grub-core/io/gzio.c:716:8: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../grub-core/io/gzio.c:711:7: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../grub-core/io/gzio.c:694:8: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../grub-core/io/gzio.c:672:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../grub-core/lib/libgcrypt-grub/cipher/serpent.c:591:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:173:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:324:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:324:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:347:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:371:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:515:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:539:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:562:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:582:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../util/grub-mkfont.c:720:7: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:918:4: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:931:4: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:946:4: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:888:7: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:876:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:873:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:870:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:716:8: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:711:7: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:694:8: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:672:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:788:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:785:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/io/gzio.c:1009:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/normal/cmdline.c:56:4: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
../../../grub-core/normal/charset.c:737:6: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
../../../grub-core/lib/libgcrypt-grub/cipher/serpent.c:591:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
../../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:173:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
gcc 4.4:
../../grub-core/disk/ldm.c:834: warning: 'res' may be used uninitialized in this function
../../grub-core/commands/testload.c:80: warning: cannot optimize loop, the loop counter may overflow
../../grub-core/fs/zfs/zfs_sha256.c:132: warning: cannot optimize loop, the loop counter may overflow
../../grub-core/lib/LzmaEnc.c:1214: warning: cannot optimize possibly infinite loops
../../grub-core/io/gzio.c:517: warning: cannot optimize possibly infinite loops
../../grub-core/io/gzio.c:716: warning: cannot optimize loop, the loop counter may overflow
../../grub-core/io/gzio.c:711: warning: cannot optimize loop, the loop counter may overflow
../../grub-core/io/gzio.c:694: warning: cannot optimize loop, the loop counter may overflow
../../grub-core/io/gzio.c:672: warning: cannot optimize loop, the loop counter may overflow
../../grub-core/lib/minilzo/minilzo.c:4187: warning: logical '&&' with non-zero constant will always evaluate as true
../../grub-core/lib/minilzo/minilzo.c:4526: warning: logical '&&' with non-zero constant will always evaluate as true
grub_script.tab.c:2133: warning: cannot optimize loop, the loop counter may overflow
../../grub-core/lib/libgcrypt-grub/cipher/serpent.c:591: warning: comparison between signed and unsigned integer expressions
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:173: warning: comparison between signed and unsigned integer expressions
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:324: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:324: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:347: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:371: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:515: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:539: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:562: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:582: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../util/grub-mkfont.c:720: warning: cannot optimize possibly infinite loops
../../../grub-core/gnulib/regexec.c:2802: warning: cannot optimize possibly infinite loops
../../../grub-core/gnulib/regexec.c:2443: warning: cannot optimize possibly infinite loops
../../../grub-core/gnulib/regcomp.c:2588: warning: cannot optimize possibly infinite loops
../../../grub-core/gnulib/regcomp.c:2554: warning: cannot optimize possibly infinite loops
../../../grub-core/io/gzio.c:517: warning: cannot optimize possibly infinite loops
../../../grub-core/io/gzio.c:918: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:931: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:946: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:888: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:876: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:873: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:870: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:716: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:711: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:694: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:672: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:788: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:785: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:1009: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/normal/cmdline.c:56: warning: cannot optimize possibly infinite loops
../../../grub-core/normal/charset.c:737: warning: cannot optimize possibly infinite loops
grub_script.tab.c:2133: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/commands/legacycfg.c:567: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/lib/minilzo/minilzo.c:4187: warning: logical '&&' with non-zero constant will always evaluate as true
../../../grub-core/lib/minilzo/minilzo.c:4526: warning: logical '&&' with non-zero constant will always evaluate as true
../../../grub-core/lib/libgcrypt-grub/cipher/serpent.c:591: warning: comparison between signed and unsigned integer expressions
../../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:173: warning: comparison between signed and unsigned integer expressions
../../grub-core/disk/ldm.c:834: warning: 'res' may be used uninitialized in this function
../../grub-core/commands/testload.c:80: warning: cannot optimize loop, the loop counter may overflow
../../grub-core/fs/zfs/zfs_sha256.c:132: warning: cannot optimize loop, the loop counter may overflow
../../grub-core/lib/LzmaEnc.c:1214: warning: cannot optimize possibly infinite loops
../../grub-core/io/gzio.c:517: warning: cannot optimize possibly infinite loops
../../grub-core/io/gzio.c:716: warning: cannot optimize loop, the loop counter may overflow
../../grub-core/io/gzio.c:711: warning: cannot optimize loop, the loop counter may overflow
../../grub-core/io/gzio.c:694: warning: cannot optimize loop, the loop counter may overflow
../../grub-core/io/gzio.c:672: warning: cannot optimize loop, the loop counter may overflow
../../grub-core/lib/minilzo/minilzo.c:4187: warning: logical '&&' with non-zero constant will always evaluate as true
../../grub-core/lib/minilzo/minilzo.c:4526: warning: logical '&&' with non-zero constant will always evaluate as true
grub_script.tab.c:2133: warning: cannot optimize loop, the loop counter may overflow
../../grub-core/lib/libgcrypt-grub/cipher/serpent.c:591: warning: comparison between signed and unsigned integer expressions
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:173: warning: comparison between signed and unsigned integer expressions
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:324: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:324: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:347: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:371: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:515: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:539: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:562: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:582: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../util/grub-mkfont.c:720: warning: cannot optimize possibly infinite loops
../../../grub-core/gnulib/regexec.c:2802: warning: cannot optimize possibly infinite loops
../../../grub-core/gnulib/regexec.c:2443: warning: cannot optimize possibly infinite loops
../../../grub-core/gnulib/regcomp.c:2588: warning: cannot optimize possibly infinite loops
../../../grub-core/gnulib/regcomp.c:2554: warning: cannot optimize possibly infinite loops
../../../grub-core/io/gzio.c:517: warning: cannot optimize possibly infinite loops
../../../grub-core/io/gzio.c:918: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:931: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:946: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:888: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:876: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:873: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:870: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:716: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:711: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:694: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:672: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:788: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:785: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/io/gzio.c:1009: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/normal/cmdline.c:56: warning: cannot optimize possibly infinite loops
../../../grub-core/normal/charset.c:737: warning: cannot optimize possibly infinite loops
grub_script.tab.c:2133: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/lib/minilzo/minilzo.c:4187: warning: logical '&&' with non-zero constant will always evaluate as true
../../../grub-core/lib/minilzo/minilzo.c:4526: warning: logical '&&' with non-zero constant will always evaluate as true
../../../grub-core/lib/libgcrypt-grub/cipher/serpent.c:591: warning: comparison between signed and unsigned integer expressions
../../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:173: warning: comparison between signed and unsigned integer expressions
Obviously most of those overlap.
--
Len Sorensen
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-22 15:50 ` Lennart Sorensen
@ 2012-02-22 15:57 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-22 16:18 ` Lennart Sorensen
0 siblings, 1 reply; 45+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-02-22 15:57 UTC (permalink / raw)
To: The development of GNU GRUB
>So with this patch, gcc 4.4 is down to 201 warnings, and gcc 4.6 has 175.
> 102 of those warnings are about missing prototypes for argp_usage
> _option_is_short and _option_is_end in argp.h which leaves 99 warnings
> for gcc 4.4 and 73 for gcc 4.6.
Hm we don't add -Wmissing-prototypes for utils
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-22 15:57 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-02-22 16:18 ` Lennart Sorensen
2012-02-22 16:25 ` Lennart Sorensen
2012-02-22 16:51 ` Lennart Sorensen
0 siblings, 2 replies; 45+ messages in thread
From: Lennart Sorensen @ 2012-02-22 16:18 UTC (permalink / raw)
To: The development of GNU GRUB
On Wed, Feb 22, 2012 at 04:57:11PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>
> >So with this patch, gcc 4.4 is down to 201 warnings, and gcc 4.6 has 175.
>
> > 102 of those warnings are about missing prototypes for argp_usage
> > _option_is_short and _option_is_end in argp.h which leaves 99 warnings
> > for gcc 4.4 and 73 for gcc 4.6.
>
> Hm we don't add -Wmissing-prototypes for utils
Well it is in WARN_FLAGS and TARGET_CFLAGS in configure.
And during build:
gcc-4.4 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"util/grub-mkimage.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I./grub-core/gnulib -I../../grub-core/gnulib -DGRUB_PKGLIBROOTDIR=\"/usr/lib/grub\" -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition -c -o util/grub_mkimage-grub-mkimage.o `test -f 'util/grub-mkimage.c' || echo '../../'`util/grub-mkimage.c
In file included from ../../util/grub-mkimage.c:45:
../../grub-core/gnulib/argp.h:610: warning: no previous prototype for 'argp_usage'
../../grub-core/gnulib/argp.h:616: warning: no previous prototype for '_option_is_short'
../../grub-core/gnulib/argp.h:628: warning: no previous prototype for '_option_is_end'
So something sure adds it.
--
Len Sorensen
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-22 16:18 ` Lennart Sorensen
@ 2012-02-22 16:25 ` Lennart Sorensen
2012-02-22 16:43 ` Lennart Sorensen
2012-02-22 16:50 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-22 16:51 ` Lennart Sorensen
1 sibling, 2 replies; 45+ messages in thread
From: Lennart Sorensen @ 2012-02-22 16:25 UTC (permalink / raw)
To: The development of GNU GRUB
On Wed, Feb 22, 2012 at 11:18:54AM -0500, Lennart Sorensen wrote:
> Well it is in WARN_FLAGS and TARGET_CFLAGS in configure.
>
> And during build:
> gcc-4.4 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"util/grub-mkimage.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I./grub-core/gnulib -I../../grub-core/gnulib -DGRUB_PKGLIBROOTDIR=\"/usr/lib/grub\" -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -W
> missing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition -c -o util/grub_mkimage-grub-mkimage.o `test -f 'util/grub-mkimage.c' || echo '../../'`util/grub-mkimage.c
> In file included from ../../util/grub-mkimage.c:45:
> ../../grub-core/gnulib/argp.h:610: warning: no previous prototype for 'argp_usage'
> ../../grub-core/gnulib/argp.h:616: warning: no previous prototype for '_option_is_short'
> ../../grub-core/gnulib/argp.h:628: warning: no previous prototype for '_option_is_end'
>
> So something sure adds it.
That actually looks like a mistake.
HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS"
TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes"
but WARN_FLAGS="-Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
So by having -Wmissing-prototypes in WARN_FLAGS it gets set twice in
TARGET_CFLAGS and also set once in HOST_CFLAGS. Perhaps that was
not meant to be in there and should only have been in TARGET_CFLAGS.
--
Len Sorensen
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-22 16:25 ` Lennart Sorensen
@ 2012-02-22 16:43 ` Lennart Sorensen
2012-02-22 16:50 ` Vladimir 'φ-coder/phcoder' Serbinenko
1 sibling, 0 replies; 45+ messages in thread
From: Lennart Sorensen @ 2012-02-22 16:43 UTC (permalink / raw)
To: The development of GNU GRUB
On Wed, Feb 22, 2012 at 11:25:22AM -0500, Lennart Sorensen wrote:
> That actually looks like a mistake.
>
> HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS"
> TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes"
>
> but WARN_FLAGS="-Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wun
> used-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
>
> So by having -Wmissing-prototypes in WARN_FLAGS it gets set twice in
> TARGET_CFLAGS and also set once in HOST_CFLAGS. Perhaps that was
> not meant to be in there and should only have been in TARGET_CFLAGS.
So I removed -Wmissing-prototypes from configure.ac, and now instead I get:
gcc-4.6 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"util/grub-mkimage.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I./grub-core/gnulib -I../../grub-core/gnulib -DGRUB_PKGLIBROOTDIR=\"/usr/lib/grub\" -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition -c -o util/grub_mkimage-grub-mkimage.o `test -f 'util/grub-mkimage.c' || echo '../../'`util/grub-mkimage.c
In file included from ../../util/grub-mkimage.c:45:0:
../../grub-core/gnulib/argp.h:610:1: warning: no previous declaration for 'argp_usage' [-Wmissing-declarations]
../../grub-core/gnulib/argp.h:616:1: warning: no previous declaration for '_option_is_short' [-Wmissing-declarations]
../../grub-core/gnulib/argp.h:628:1: warning: no previous declaration for '_option_is_end' [-Wmissing-declarations]
Does -Wmissing-declarations have to go too?
--
Len Sorensen
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-22 16:25 ` Lennart Sorensen
2012-02-22 16:43 ` Lennart Sorensen
@ 2012-02-22 16:50 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-22 17:16 ` Lennart Sorensen
1 sibling, 1 reply; 45+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-02-22 16:50 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 4241 bytes --]
On 22.02.2012 17:25, Lennart Sorensen wrote:
> On Wed, Feb 22, 2012 at 11:18:54AM -0500, Lennart Sorensen wrote:
>> Well it is in WARN_FLAGS and TARGET_CFLAGS in configure.
>>
>> And during build:
>> gcc-4.4 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"util/grub-mkimage.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I./grub-core/gnulib -I../../grub-core/gnulib -DGRUB_PKGLIBROOTDIR=\"/usr/lib/grub\" -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -W
>> missing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition -c -o util/grub_mkimage-grub-mkimage.o `test -f 'util/grub-mkimage.c' || echo '../../'`util/grub-mkimage.c
>> In file included from ../../util/grub-mkimage.c:45:
>> ../../grub-core/gnulib/argp.h:610: warning: no previous prototype for 'argp_usage'
>> ../../grub-core/gnulib/argp.h:616: warning: no previous prototype for '_option_is_short'
>> ../../grub-core/gnulib/argp.h:628: warning: no previous prototype for '_option_is_end'
>>
>> So something sure adds it.
> That actually looks like a mistake.
>
> HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS"
> TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes"
>
> but WARN_FLAGS="-Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
>
> So by having -Wmissing-prototypes in WARN_FLAGS it gets set twice in
> TARGET_CFLAGS and also set once in HOST_CFLAGS. Perhaps that was
> not meant to be in there and should only have been in TARGET_CFLAGS.
>
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: warn.diff --]
[-- Type: text/x-diff; name="warn.diff", Size: 9600 bytes --]
=== modified file 'conf/Makefile.common'
--- conf/Makefile.common 2012-02-22 15:27:39 +0000
+++ conf/Makefile.common 2012-02-22 16:29:31 +0000
@@ -104,7 +104,7 @@
CFLAGS_GCRY = -Wno-error -Wno-missing-field-initializers
CPPFLAGS_GCRY = -I$(top_srcdir)/grub-core/lib/libgcrypt_wrap
-CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition
+CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition -Wno-unsafe-loop-optimisations
CPPFLAGS_GNULIB = -I$(top_builddir)/grub-core/gnulib -I$(top_srcdir)/grub-core/gnulib
CFLAGS_POSIX = -fno-builtin
=== modified file 'configure.ac'
--- configure.ac 2012-02-22 03:56:45 +0000
+++ configure.ac 2012-02-22 16:32:32 +0000
@@ -377,7 +377,7 @@
LIBS=""
# debug flags.
-WARN_FLAGS="-Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
+WARN_FLAGS="-Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS"
TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes"
TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g"
=== modified file 'grub-core/commands/legacycfg.c'
--- grub-core/commands/legacycfg.c 2012-02-12 14:25:25 +0000
+++ grub-core/commands/legacycfg.c 2012-02-22 16:06:00 +0000
@@ -547,11 +547,11 @@
check_password_md5_real (const char *entered,
struct legacy_md5_password *pw)
{
- int enteredlen = grub_strlen (entered);
+ grub_size_t enteredlen = grub_strlen (entered);
unsigned char alt_result[MD5_HASHLEN];
unsigned char *digest;
grub_uint8_t ctx[GRUB_MD_MD5->contextsize];
- int i;
+ grub_size_t i;
GRUB_MD_MD5->init (ctx);
GRUB_MD_MD5->write (ctx, entered, enteredlen);
=== modified file 'grub-core/commands/testload.c'
--- grub-core/commands/testload.c 2012-02-22 04:04:54 +0000
+++ grub-core/commands/testload.c 2012-02-22 16:25:36 +0000
@@ -77,19 +77,24 @@
grub_printf ("Reading %s sequentially again", argv[0]);
grub_file_seek (file, 0);
- for (pos = 0; pos < size; pos += GRUB_DISK_SECTOR_SIZE)
+ for (pos = 0; pos < size;)
{
char sector[GRUB_DISK_SECTOR_SIZE];
-
- if (grub_file_read (file, sector, GRUB_DISK_SECTOR_SIZE)
- != GRUB_DISK_SECTOR_SIZE)
+ grub_size_t curlen = GRUB_DISK_SECTOR_SIZE;
+
+ if (curlen > size - pos)
+ curlen = size - pos;
+
+ if (grub_file_read (file, sector, curlen)
+ != (grub_ssize_t) curlen)
goto fail;
- if (grub_memcmp (sector, buf + pos, GRUB_DISK_SECTOR_SIZE) != 0)
+ if (grub_memcmp (sector, buf + pos, curlen) != 0)
{
grub_printf ("\nDiffers in %lld\n", (unsigned long long) pos);
goto fail;
}
+ pos += curlen;
}
grub_printf (" Done.\n");
=== modified file 'grub-core/disk/ldm.c'
--- grub-core/disk/ldm.c 2012-02-10 11:36:02 +0000
+++ grub-core/disk/ldm.c 2012-02-22 15:59:21 +0000
@@ -831,7 +831,7 @@
{
struct grub_diskfilter_pv *pv = NULL;
struct grub_diskfilter_vg *vg = NULL;
- struct grub_diskfilter_lv *res, *lv;
+ struct grub_diskfilter_lv *res = 0, *lv, *res_lv;
pv = grub_diskfilter_get_pv_from_disk (disk, &vg);
@@ -844,19 +844,21 @@
&& lv->segments->nodes->pv == pv
&& lv->segments->nodes->start + pv->start_sector == start)
{
- res = lv;
+ res_lv = lv;
break;
}
+ if (!res_lv)
+ return NULL;
for (lv = vg->lvs; lv; lv = lv->next)
if (lv->segment_count == 1 && lv->segments->node_count == 1
&& lv->segments->type == GRUB_DISKFILTER_MIRROR
- && lv->segments->nodes->lv == lv)
+ && lv->segments->nodes->lv == res_lv)
{
res = lv;
break;
}
- if (res->fullname)
- return grub_strdup (lv->fullname);
+ if (res && res->fullname)
+ return grub_strdup (res->fullname);
return NULL;
}
=== modified file 'grub-core/fs/zfs/zfs_sha256.c'
--- grub-core/fs/zfs/zfs_sha256.c 2010-12-01 21:55:26 +0000
+++ grub-core/fs/zfs/zfs_sha256.c 2012-02-22 16:17:39 +0000
@@ -129,7 +129,7 @@
for (i = 0; i < 8; i++)
pad[padsize++] = (size << 3) >> (56 - 8 * i);
- for (i = 0; i < padsize; i += 64)
+ for (i = 0; i < padsize && i <= 64; i += 64)
SHA256Transform(H, pad + i);
zcp->zc_word[0] = grub_cpu_to_zfs64 ((grub_uint64_t)H[0] << 32 | H[1],
=== modified file 'grub-core/io/gzio.c'
--- grub-core/io/gzio.c 2012-02-12 14:25:25 +0000
+++ grub-core/io/gzio.c 2012-02-22 16:45:45 +0000
@@ -363,6 +363,8 @@
0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
};
+#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
+
#define NEEDBITS(n) do {while(k<(n)){b|=((ulg)get_byte(gzio))<<k;k+=8;}} while (0)
#define DUMPBITS(n) do {b>>=(n);k-=(n);} while (0)
=== modified file 'grub-core/lib/LzmaEnc.c'
--- grub-core/lib/LzmaEnc.c 2012-02-10 15:48:48 +0000
+++ grub-core/lib/LzmaEnc.c 2012-02-22 16:16:26 +0000
@@ -1211,7 +1211,7 @@
{
UInt32 i;
reps[0] = prevOpt->backs[pos];
- for (i = 1; i <= pos; i++)
+ for (i = 1; i < pos + 1; i++)
reps[i] = prevOpt->backs[i - 1];
for (; i < LZMA_NUM_REPS; i++)
reps[i] = prevOpt->backs[i];
=== modified file 'grub-core/normal/cmdline.c'
--- grub-core/normal/cmdline.c 2012-02-12 18:24:23 +0000
+++ grub-core/normal/cmdline.c 2012-02-22 16:21:47 +0000
@@ -49,13 +49,13 @@
/* Remove the lines that don't fit in the new buffer. */
if (newsize < hist_used)
{
- int i;
- int delsize = hist_used - newsize;
+ grub_size_t i;
+ grub_size_t delsize = hist_used - newsize;
hist_used = newsize;
- for (i = 1; i <= delsize; i++)
+ for (i = 1; i < delsize + 1; i++)
{
- int pos = hist_end - i;
+ grub_ssize_t pos = hist_end - i;
if (pos < 0)
pos += hist_size;
grub_free (old_hist_lines[pos]);
=== modified file 'grub-core/script/parser.y'
--- grub-core/script/parser.y 2012-02-10 15:48:48 +0000
+++ grub-core/script/parser.y 2012-02-22 16:47:55 +0000
@@ -31,6 +31,7 @@
#include "grub_script.tab.h"
#pragma GCC diagnostic ignored "-Wunreachable-code"
+#pragma GCC diagnostic ignored "-Wmissing-declarations"
%}
%union {
=== modified file 'grub-core/script/yylex.l'
--- grub-core/script/yylex.l 2012-02-03 10:56:49 +0000
+++ grub-core/script/yylex.l 2012-02-22 16:49:25 +0000
@@ -27,6 +27,8 @@
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
+#pragma GCC diagnostic ignored "-Wmissing-declarations"
+#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
#define yyfree grub_lexer_yyfree
#define yyalloc grub_lexer_yyalloc
=== modified file 'util/grub-mkfont.c'
--- util/grub-mkfont.c 2012-02-10 12:31:43 +0000
+++ util/grub-mkfont.c 2012-02-22 16:15:31 +0000
@@ -717,7 +717,7 @@
bitmap = glyph->bitmap;
mask = 0x80;
- for (y = ymax - 1; y >= ymin; y--)
+ for (y = ymax - 1; y > ymin - 1; y--)
{
int line_pos;
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-22 16:18 ` Lennart Sorensen
2012-02-22 16:25 ` Lennart Sorensen
@ 2012-02-22 16:51 ` Lennart Sorensen
1 sibling, 0 replies; 45+ messages in thread
From: Lennart Sorensen @ 2012-02-22 16:51 UTC (permalink / raw)
To: The development of GNU GRUB
On Wed, Feb 22, 2012 at 11:18:54AM -0500, Lennart Sorensen wrote:
> On Wed, Feb 22, 2012 at 04:57:11PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> >
> > >So with this patch, gcc 4.4 is down to 201 warnings, and gcc 4.6 has 175.
> >
> > > 102 of those warnings are about missing prototypes for argp_usage
> > > _option_is_short and _option_is_end in argp.h which leaves 99 warnings
> > > for gcc 4.4 and 73 for gcc 4.6.
> >
> > Hm we don't add -Wmissing-prototypes for utils
>
> Well it is in WARN_FLAGS and TARGET_CFLAGS in configure.
WARN_FLAGS appears to be new as of Feb 10.
As far as I can tell, the duplication of -Wmissing-prototypes was in:
2012-02-11 Vladimir Serbinenko <phcoder@gmail.com>
* configure.ac: Remove -Winline altogether and -Wmissing-prototypes on
utils.
* util/import_gcry.py: Add -Wno-strict-aliasing on checked modules.
which added -Wmissing-prototypes it to TARGET_CFLAGS, and removed some
stuff from WARN_FLAGS, but did not remove -Wmissing-prototypes from
WARN_FLAGS entirely (since it was actually there twice before, and now
is only there once).
--
Len Sorensen
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-22 16:50 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-02-22 17:16 ` Lennart Sorensen
2012-02-22 17:35 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-22 17:38 ` Lennart Sorensen
0 siblings, 2 replies; 45+ messages in thread
From: Lennart Sorensen @ 2012-02-22 17:16 UTC (permalink / raw)
To: The development of GNU GRUB
On Wed, Feb 22, 2012 at 05:50:31PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> === modified file 'conf/Makefile.common'
> --- conf/Makefile.common 2012-02-22 15:27:39 +0000
> +++ conf/Makefile.common 2012-02-22 16:29:31 +0000
> @@ -104,7 +104,7 @@
> CFLAGS_GCRY = -Wno-error -Wno-missing-field-initializers
> CPPFLAGS_GCRY = -I$(top_srcdir)/grub-core/lib/libgcrypt_wrap
>
> -CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition
> +CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition -Wno-unsafe-loop-optimisations
> CPPFLAGS_GNULIB = -I$(top_builddir)/grub-core/gnulib -I$(top_srcdir)/grub-core/gnulib
>
> CFLAGS_POSIX = -fno-builtin
>
> === modified file 'configure.ac'
> --- configure.ac 2012-02-22 03:56:45 +0000
> +++ configure.ac 2012-02-22 16:32:32 +0000
> @@ -377,7 +377,7 @@
> LIBS=""
>
> # debug flags.
> -WARN_FLAGS="-Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
> +WARN_FLAGS="-Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
> HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS"
> TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes"
> TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g"
[snip]
OK I checked out the latest bzr tree, and applied this patch.
I now get:
../../grub-core/gnulib/argp.h:610:1: warning: no previous declaration for 'argp_usage' [-Wmissing-declarations]
../../grub-core/gnulib/argp.h:616:1: warning: no previous declaration for '_option_is_short' [-Wmissing-declarations]
../../grub-core/gnulib/argp.h:628:1: warning: no previous declaration for '_option_is_end' [-Wmissing-declarations]
instead of the missing prototypes.
Other than that we are down to:
../../grub-core/disk/ldm.c:834: warning: 'res_lv' may be used uninitialized in this function
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
../../grub-core/lib/minilzo/minilzo.c:4187: warning: logical '&&' with non-zero constant will always evaluate as true
../../grub-core/lib/minilzo/minilzo.c:4526: warning: logical '&&' with non-zero constant will always evaluate as true
grub_script.tab.c:2134: warning: cannot optimize loop, the loop counter may overflow
../../grub-core/lib/libgcrypt-grub/cipher/serpent.c:591: warning: comparison between signed and unsigned integer expressions
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:173: warning: comparison between signed and unsigned integer expressions
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:324: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:324: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:347: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:371: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:515: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:539: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:562: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:582: warning: dereferencing type-punned pointer will break strict-aliasing rules
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
../../util/grub-mkfont.c:720: warning: cannot optimize possibly infinite loops
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
../../../grub-core/gnulib/regexec.c:2802: warning: cannot optimize possibly infinite loops
../../../grub-core/gnulib/regexec.c:2443: warning: cannot optimize possibly infinite loops
../../../grub-core/gnulib/regcomp.c:2588: warning: cannot optimize possibly infinite loops
../../../grub-core/gnulib/regcomp.c:2554: warning: cannot optimize possibly infinite loops
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
../../../grub-core/normal/charset.c:737: warning: cannot optimize possibly infinite loops
grub_script.tab.c:2134: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/net/net.c:621: warning: cannot optimize possibly infinite loops
../../../grub-core/commands/legacycfg.c:567: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/lib/minilzo/minilzo.c:4187: warning: logical '&&' with non-zero constant will always evaluate as true
../../../grub-core/lib/minilzo/minilzo.c:4526: warning: logical '&&' with non-zero constant will always evaluate as true
../../../grub-core/lib/libgcrypt-grub/cipher/serpent.c:591: warning: comparison between signed and unsigned integer expressions
../../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:173: warning: comparison between signed and unsigned integer expressions
grub.po: warning: Charset "CHARSET" is not a portable encoding name.
../../grub-core/disk/ldm.c:834: warning: 'res_lv' may be used uninitialized in this function
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
../../grub-core/lib/minilzo/minilzo.c:4187: warning: logical '&&' with non-zero constant will always evaluate as true
../../grub-core/lib/minilzo/minilzo.c:4526: warning: logical '&&' with non-zero constant will always evaluate as true
grub_script.tab.c:2134: warning: cannot optimize loop, the loop counter may overflow
../../grub-core/lib/libgcrypt-grub/cipher/serpent.c:591: warning: comparison between signed and unsigned integer expressions
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:173: warning: comparison between signed and unsigned integer expressions
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:324: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:324: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:347: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:371: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:515: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:539: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:562: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:582: warning: dereferencing type-punned pointer will break strict-aliasing rules
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
../../util/grub-mkfont.c:720: warning: cannot optimize possibly infinite loops
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
../../../grub-core/gnulib/regexec.c:2802: warning: cannot optimize possibly infinite loops
../../../grub-core/gnulib/regexec.c:2443: warning: cannot optimize possibly infinite loops
../../../grub-core/gnulib/regcomp.c:2588: warning: cannot optimize possibly infinite loops
../../../grub-core/gnulib/regcomp.c:2554: warning: cannot optimize possibly infinite loops
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations"
../../../grub-core/normal/charset.c:737: warning: cannot optimize possibly infinite loops
grub_script.tab.c:2134: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/net/net.c:621: warning: cannot optimize possibly infinite loops
../../../grub-core/lib/minilzo/minilzo.c:4187: warning: logical '&&' with non-zero constant will always evaluate as true
../../../grub-core/lib/minilzo/minilzo.c:4526: warning: logical '&&' with non-zero constant will always evaluate as true
../../../grub-core/lib/libgcrypt-grub/cipher/serpent.c:591: warning: comparison between signed and unsigned integer expressions
../../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:173: warning: comparison between signed and unsigned integer expressions
Apparently gcc 4.4 doesn't like -Wno-unsafe-loop-optimisations. Neither does gcc 4.6:
../../grub-core/disk/ldm.c:850:6: warning: 'res_lv' may be used uninitialized in this function [-Wuninitialized]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
../../grub-core/lib/libgcrypt-grub/cipher/serpent.c:591:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:173:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:324:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:324:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:347:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:371:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:515:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:539:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:562:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:582:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
../../util/grub-mkfont.c:720:7: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
../../../grub-core/normal/charset.c:737:6: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
../../../grub-core/commands/legacycfg.c:567:3: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
../../../grub-core/lib/libgcrypt-grub/cipher/serpent.c:591:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
../../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:173:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
grub.po: warning: Charset "CHARSET" is not a portable encoding name.
../../grub-core/disk/ldm.c:850:6: warning: 'res_lv' may be used uninitialized in this function [-Wuninitialized]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
../../grub-core/lib/libgcrypt-grub/cipher/serpent.c:591:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:173:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:324:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:324:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:347:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:371:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:515:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:539:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:562:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:582:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
../../util/grub-mkfont.c:720:7: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-unsafe-loop-optimisations" [enabled by default]
../../../grub-core/normal/charset.c:737:6: warning: cannot optimize possibly infinite loops [-Wunsafe-loop-optimizations]
../../../grub-core/lib/libgcrypt-grub/cipher/serpent.c:591:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
../../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:173:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
I don't think -Wno-unsafe-loop-optimisations is valid. One has to remove
-Wunsafe-loop-optimisations instead, which is currently in WARN_FLAGS.
--
Len Sorensen
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-22 17:16 ` Lennart Sorensen
@ 2012-02-22 17:35 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-22 17:41 ` Lennart Sorensen
2012-02-22 17:38 ` Lennart Sorensen
1 sibling, 1 reply; 45+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-02-22 17:35 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 300 bytes --]
> I don't think -Wno-unsafe-loop-optimisations is valid. One has to
remove -Wunsafe-loop-optimisations instead, which is currently in
WARN_FLAGS.
It's just a question of spelling.
Also note that warnings from gnulib and minilzo are -Wno-error
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: warn.diff --]
[-- Type: text/x-diff; name="warn.diff", Size: 11798 bytes --]
=== modified file 'conf/Makefile.common'
--- conf/Makefile.common 2012-02-22 15:27:39 +0000
+++ conf/Makefile.common 2012-02-22 17:26:03 +0000
@@ -104,7 +104,7 @@
CFLAGS_GCRY = -Wno-error -Wno-missing-field-initializers
CPPFLAGS_GCRY = -I$(top_srcdir)/grub-core/lib/libgcrypt_wrap
-CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition
+CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition -Wno-unsafe-loop-optimizations
CPPFLAGS_GNULIB = -I$(top_builddir)/grub-core/gnulib -I$(top_srcdir)/grub-core/gnulib
CFLAGS_POSIX = -fno-builtin
=== modified file 'configure.ac'
--- configure.ac 2012-02-22 03:56:45 +0000
+++ configure.ac 2012-02-22 16:51:06 +0000
@@ -377,9 +377,9 @@
LIBS=""
# debug flags.
-WARN_FLAGS="-Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
+WARN_FLAGS="-Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-parameter-type -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS"
-TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes"
+TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations"
TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g"
# Force no alignment to save space on i386.
=== modified file 'grub-core/commands/legacycfg.c'
--- grub-core/commands/legacycfg.c 2012-02-12 14:25:25 +0000
+++ grub-core/commands/legacycfg.c 2012-02-22 17:34:01 +0000
@@ -543,15 +543,17 @@
grub_uint8_t hash[MD5_HASHLEN];
};
+#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
+
static int
check_password_md5_real (const char *entered,
struct legacy_md5_password *pw)
{
- int enteredlen = grub_strlen (entered);
+ grub_size_t enteredlen = grub_strlen (entered);
unsigned char alt_result[MD5_HASHLEN];
unsigned char *digest;
grub_uint8_t ctx[GRUB_MD_MD5->contextsize];
- int i;
+ grub_size_t i;
GRUB_MD_MD5->init (ctx);
GRUB_MD_MD5->write (ctx, entered, enteredlen);
@@ -600,6 +602,8 @@
return (grub_crypto_memcmp (digest, pw->hash, MD5_HASHLEN) == 0);
}
+#pragma GCC diagnostic error "-Wunsafe-loop-optimizations"
+
static grub_err_t
check_password_md5 (const char *user,
const char *entered,
=== modified file 'grub-core/commands/testload.c'
--- grub-core/commands/testload.c 2012-02-22 04:04:54 +0000
+++ grub-core/commands/testload.c 2012-02-22 16:25:36 +0000
@@ -77,19 +77,24 @@
grub_printf ("Reading %s sequentially again", argv[0]);
grub_file_seek (file, 0);
- for (pos = 0; pos < size; pos += GRUB_DISK_SECTOR_SIZE)
+ for (pos = 0; pos < size;)
{
char sector[GRUB_DISK_SECTOR_SIZE];
-
- if (grub_file_read (file, sector, GRUB_DISK_SECTOR_SIZE)
- != GRUB_DISK_SECTOR_SIZE)
+ grub_size_t curlen = GRUB_DISK_SECTOR_SIZE;
+
+ if (curlen > size - pos)
+ curlen = size - pos;
+
+ if (grub_file_read (file, sector, curlen)
+ != (grub_ssize_t) curlen)
goto fail;
- if (grub_memcmp (sector, buf + pos, GRUB_DISK_SECTOR_SIZE) != 0)
+ if (grub_memcmp (sector, buf + pos, curlen) != 0)
{
grub_printf ("\nDiffers in %lld\n", (unsigned long long) pos);
goto fail;
}
+ pos += curlen;
}
grub_printf (" Done.\n");
=== modified file 'grub-core/disk/ldm.c'
--- grub-core/disk/ldm.c 2012-02-10 11:36:02 +0000
+++ grub-core/disk/ldm.c 2012-02-22 17:26:19 +0000
@@ -831,7 +831,7 @@
{
struct grub_diskfilter_pv *pv = NULL;
struct grub_diskfilter_vg *vg = NULL;
- struct grub_diskfilter_lv *res, *lv;
+ struct grub_diskfilter_lv *res = 0, *lv, *res_lv = 0;
pv = grub_diskfilter_get_pv_from_disk (disk, &vg);
@@ -844,19 +844,21 @@
&& lv->segments->nodes->pv == pv
&& lv->segments->nodes->start + pv->start_sector == start)
{
- res = lv;
+ res_lv = lv;
break;
}
+ if (!res_lv)
+ return NULL;
for (lv = vg->lvs; lv; lv = lv->next)
if (lv->segment_count == 1 && lv->segments->node_count == 1
&& lv->segments->type == GRUB_DISKFILTER_MIRROR
- && lv->segments->nodes->lv == lv)
+ && lv->segments->nodes->lv == res_lv)
{
res = lv;
break;
}
- if (res->fullname)
- return grub_strdup (lv->fullname);
+ if (res && res->fullname)
+ return grub_strdup (res->fullname);
return NULL;
}
=== modified file 'grub-core/fs/zfs/zfs_sha256.c'
--- grub-core/fs/zfs/zfs_sha256.c 2010-12-01 21:55:26 +0000
+++ grub-core/fs/zfs/zfs_sha256.c 2012-02-22 16:17:39 +0000
@@ -129,7 +129,7 @@
for (i = 0; i < 8; i++)
pad[padsize++] = (size << 3) >> (56 - 8 * i);
- for (i = 0; i < padsize; i += 64)
+ for (i = 0; i < padsize && i <= 64; i += 64)
SHA256Transform(H, pad + i);
zcp->zc_word[0] = grub_cpu_to_zfs64 ((grub_uint64_t)H[0] << 32 | H[1],
=== modified file 'grub-core/io/gzio.c'
--- grub-core/io/gzio.c 2012-02-12 14:25:25 +0000
+++ grub-core/io/gzio.c 2012-02-22 16:45:45 +0000
@@ -363,6 +363,8 @@
0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
};
+#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
+
#define NEEDBITS(n) do {while(k<(n)){b|=((ulg)get_byte(gzio))<<k;k+=8;}} while (0)
#define DUMPBITS(n) do {b>>=(n);k-=(n);} while (0)
=== modified file 'grub-core/lib/LzmaEnc.c'
--- grub-core/lib/LzmaEnc.c 2012-02-10 15:48:48 +0000
+++ grub-core/lib/LzmaEnc.c 2012-02-22 16:16:26 +0000
@@ -1211,7 +1211,7 @@
{
UInt32 i;
reps[0] = prevOpt->backs[pos];
- for (i = 1; i <= pos; i++)
+ for (i = 1; i < pos + 1; i++)
reps[i] = prevOpt->backs[i - 1];
for (; i < LZMA_NUM_REPS; i++)
reps[i] = prevOpt->backs[i];
=== modified file 'grub-core/net/net.c'
--- grub-core/net/net.c 2012-02-21 15:16:45 +0000
+++ grub-core/net/net.c 2012-02-22 17:32:44 +0000
@@ -602,6 +602,8 @@
return 0;
}
+#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
+
grub_err_t
grub_net_route_address (grub_net_network_level_address_t addr,
grub_net_network_level_address_t *gateway,
@@ -648,6 +650,8 @@
N_("route loop detected"));
}
+#pragma GCC diagnostic error "-Wunsafe-loop-optimizations"
+
static grub_err_t
grub_cmd_deladdr (struct grub_command *cmd __attribute__ ((unused)),
int argc, char **args)
=== modified file 'grub-core/normal/charset.c'
--- grub-core/normal/charset.c 2012-02-22 04:19:11 +0000
+++ grub-core/normal/charset.c 2012-02-22 17:33:42 +0000
@@ -589,6 +589,8 @@
return ptr - in;
}
+#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
+
static grub_ssize_t
bidi_line_wrap (struct grub_unicode_glyph *visual_out,
struct grub_unicode_glyph *visual,
@@ -780,6 +782,7 @@
return outptr - visual_out;
}
+#pragma GCC diagnostic error "-Wunsafe-loop-optimizations"
static grub_ssize_t
grub_bidi_line_logical_to_visual (const grub_uint32_t *logical,
=== modified file 'grub-core/normal/cmdline.c'
--- grub-core/normal/cmdline.c 2012-02-12 18:24:23 +0000
+++ grub-core/normal/cmdline.c 2012-02-22 16:21:47 +0000
@@ -49,13 +49,13 @@
/* Remove the lines that don't fit in the new buffer. */
if (newsize < hist_used)
{
- int i;
- int delsize = hist_used - newsize;
+ grub_size_t i;
+ grub_size_t delsize = hist_used - newsize;
hist_used = newsize;
- for (i = 1; i <= delsize; i++)
+ for (i = 1; i < delsize + 1; i++)
{
- int pos = hist_end - i;
+ grub_ssize_t pos = hist_end - i;
if (pos < 0)
pos += hist_size;
grub_free (old_hist_lines[pos]);
=== modified file 'grub-core/script/parser.y'
--- grub-core/script/parser.y 2012-02-10 15:48:48 +0000
+++ grub-core/script/parser.y 2012-02-22 17:31:45 +0000
@@ -31,6 +31,9 @@
#include "grub_script.tab.h"
#pragma GCC diagnostic ignored "-Wunreachable-code"
+#pragma GCC diagnostic ignored "-Wmissing-declarations"
+#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
+
%}
%union {
=== modified file 'grub-core/script/yylex.l'
--- grub-core/script/yylex.l 2012-02-03 10:56:49 +0000
+++ grub-core/script/yylex.l 2012-02-22 16:49:25 +0000
@@ -27,6 +27,8 @@
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
+#pragma GCC diagnostic ignored "-Wmissing-declarations"
+#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
#define yyfree grub_lexer_yyfree
#define yyalloc grub_lexer_yyalloc
=== modified file 'util/grub-mkfont.c'
--- util/grub-mkfont.c 2012-02-10 12:31:43 +0000
+++ util/grub-mkfont.c 2012-02-22 17:33:14 +0000
@@ -681,6 +681,8 @@
*offset += 10;
}
+#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
+
static void
print_glyphs (struct grub_font_info *font_info)
{
@@ -717,7 +719,7 @@
bitmap = glyph->bitmap;
mask = 0x80;
- for (y = ymax - 1; y >= ymin; y--)
+ for (y = ymax - 1; y > ymin - 1; y--)
{
int line_pos;
@@ -753,6 +755,8 @@
}
}
+#pragma GCC diagnostic error "-Wunsafe-loop-optimizations"
+
static void
write_font_ascii_bitmap (struct grub_font_info *font_info, char *output_file)
{
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-22 17:16 ` Lennart Sorensen
2012-02-22 17:35 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-02-22 17:38 ` Lennart Sorensen
1 sibling, 0 replies; 45+ messages in thread
From: Lennart Sorensen @ 2012-02-22 17:38 UTC (permalink / raw)
To: The development of GNU GRUB
On Wed, Feb 22, 2012 at 12:16:12PM -0500, Lennart Sorensen wrote:
> OK I checked out the latest bzr tree, and applied this patch.
>
> I now get:
> ../../grub-core/gnulib/argp.h:610:1: warning: no previous declaration for 'argp_usage' [-Wmissing-declarations]
> ../../grub-core/gnulib/argp.h:616:1: warning: no previous declaration for '_option_is_short' [-Wmissing-declarations]
> ../../grub-core/gnulib/argp.h:628:1: warning: no previous declaration for '_option_is_end' [-Wmissing-declarations]
>
> instead of the missing prototypes.
Taking out the -Wno-unsafe-loop-optimisation (and ignoring the argp.h
issue above) reduces it to:
../../grub-core/disk/ldm.c:834: warning: 'res_lv' may be used uninitialized in this function
../../grub-core/lib/minilzo/minilzo.c:4187: warning: logical '&&' with non-zero constant will always evaluate as true
../../grub-core/lib/minilzo/minilzo.c:4526: warning: logical '&&' with non-zero constant will always evaluate as true
grub_script.tab.c:2134: warning: cannot optimize loop, the loop counter may overflow
../../grub-core/lib/libgcrypt-grub/cipher/serpent.c:591: warning: comparison between signed and unsigned integer expressions
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:173: warning: comparison between signed and unsigned integer expressions
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:324: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:324: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:347: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:371: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:515: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:539: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:562: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:582: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../util/grub-mkfont.c:720: warning: cannot optimize possibly infinite loops
../../../grub-core/gnulib/regexec.c:2802: warning: cannot optimize possibly infinite loops
../../../grub-core/gnulib/regexec.c:2443: warning: cannot optimize possibly infinite loops
../../../grub-core/gnulib/regcomp.c:2588: warning: cannot optimize possibly infinite loops
../../../grub-core/gnulib/regcomp.c:2554: warning: cannot optimize possibly infinite loops
../../../grub-core/normal/charset.c:737: warning: cannot optimize possibly infinite loops
grub_script.tab.c:2134: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/net/net.c:621: warning: cannot optimize possibly infinite loops
../../../grub-core/commands/legacycfg.c:567: warning: cannot optimize loop, the loop counter may overflow
../../../grub-core/lib/minilzo/minilzo.c:4187: warning: logical '&&' with non-zero constant will always evaluate as true
../../../grub-core/lib/minilzo/minilzo.c:4526: warning: logical '&&' with non-zero constant will always evaluate as true
../../../grub-core/lib/libgcrypt-grub/cipher/serpent.c:591: warning: comparison between signed and unsigned integer expressions
../../../grub-core/lib/libgcrypt-grub/cipher/rijndael.c:173: warning: comparison between signed and unsigned integer expressions
--
Len Sorensen
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-22 17:35 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-02-22 17:41 ` Lennart Sorensen
2012-02-22 17:46 ` Lennart Sorensen
0 siblings, 1 reply; 45+ messages in thread
From: Lennart Sorensen @ 2012-02-22 17:41 UTC (permalink / raw)
To: The development of GNU GRUB
On Wed, Feb 22, 2012 at 06:35:49PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> > I don't think -Wno-unsafe-loop-optimisations is valid. One has to
> remove -Wunsafe-loop-optimisations instead, which is currently in
> WARN_FLAGS.
> It's just a question of spelling.
> Also note that warnings from gnulib and minilzo are -Wno-error
Oh OK.
Building now.
--
Len Sorensen
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-22 17:41 ` Lennart Sorensen
@ 2012-02-22 17:46 ` Lennart Sorensen
2012-02-22 18:01 ` Lennart Sorensen
0 siblings, 1 reply; 45+ messages in thread
From: Lennart Sorensen @ 2012-02-22 17:46 UTC (permalink / raw)
To: The development of GNU GRUB
On Wed, Feb 22, 2012 at 12:41:56PM -0500, Lennart Sorensen wrote:
> On Wed, Feb 22, 2012 at 06:35:49PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> > > I don't think -Wno-unsafe-loop-optimisations is valid. One has to
> > remove -Wunsafe-loop-optimisations instead, which is currently in
> > WARN_FLAGS.
> > It's just a question of spelling.
> > Also note that warnings from gnulib and minilzo are -Wno-error
>
> Oh OK.
>
> Building now.
Hmm.
gcc-4.4 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"util/grub-mkfont.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I./grub-core/gnulib -I../../grub-core/gnulib -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-parameter-type -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition -Wno-unsafe-loop-optimizations -I/usr/include/freetype2 -c -o util/grub_mkfont-grub-mkfont.o `test -f 'util/grub-mkfont.c' || echo '../../'`util/grub-mkfont.c
../../util/grub-mkfont.c: In function 'main':
../../util/grub-mkfont.c:722: error: cannot optimize possibly infinite loops
That was unexpected. --disable-werror didn't prevent that from failing.
--
Len Sorensen
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-22 17:46 ` Lennart Sorensen
@ 2012-02-22 18:01 ` Lennart Sorensen
2012-02-22 18:28 ` Lennart Sorensen
0 siblings, 1 reply; 45+ messages in thread
From: Lennart Sorensen @ 2012-02-22 18:01 UTC (permalink / raw)
To: The development of GNU GRUB
On Wed, Feb 22, 2012 at 12:46:14PM -0500, Lennart Sorensen wrote:
> Hmm.
>
> gcc-4.4 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"util/grub-mkfont.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I./grub-core/gnulib -I../../grub-core/gnulib -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-for
> mat-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-parameter-type -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition -Wno-unsafe-loop-optimizations -I/usr/include/freetype2 -c -o util/grub_mkfont-grub-mkfont.o `test -f 'util/grub-mkfont.c' || echo '../../'`util/grub-mkfont.c
> ../../util/grub-mkfont.c: In function 'main':
> ../../util/grub-mkfont.c:722: error: cannot optimize possibly infinite loops
>
> That was unexpected. --disable-werror didn't prevent that from failing.
gcc 4.6 on the other hand now seems to compile with -Werror enabled.
--
Len Sorensen
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-22 18:01 ` Lennart Sorensen
@ 2012-02-22 18:28 ` Lennart Sorensen
2012-02-22 18:41 ` Lennart Sorensen
0 siblings, 1 reply; 45+ messages in thread
From: Lennart Sorensen @ 2012-02-22 18:28 UTC (permalink / raw)
To: The development of GNU GRUB
On Wed, Feb 22, 2012 at 01:01:41PM -0500, Lennart Sorensen wrote:
> gcc 4.6 on the other hand now seems to compile with -Werror enabled.
Oh the feature for doing multiple #pragma statements throughout the code
is new in gcc 4.6. It can't be done in earlier versions. In older
versions whatever you say last applies to the whole file.
Perhaps a slightly ugly solution could solve it by having a #if that
checks that gcc is 4.6 or higher around the #pragma that reenables
the warning.
ie:
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
#pragma GCC diagnostic error "-Wunsafe-loop-optimizations"
#endif
At least this way you get to have the warning for most of the code on
newer gcc versions, but don't break older gcc versions that are still
in common use.
--
Len Sorensen
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-22 18:28 ` Lennart Sorensen
@ 2012-02-22 18:41 ` Lennart Sorensen
2012-02-22 19:00 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 45+ messages in thread
From: Lennart Sorensen @ 2012-02-22 18:41 UTC (permalink / raw)
To: The development of GNU GRUB
On Wed, Feb 22, 2012 at 01:28:06PM -0500, Lennart Sorensen wrote:
> Oh the feature for doing multiple #pragma statements throughout the code
> is new in gcc 4.6. It can't be done in earlier versions. In older
> versions whatever you say last applies to the whole file.
>
> Perhaps a slightly ugly solution could solve it by having a #if that
> checks that gcc is 4.6 or higher around the #pragma that reenables
> the warning.
>
> ie:
>
> #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
> #pragma GCC diagnostic error "-Wunsafe-loop-optimizations"
> #endif
>
> At least this way you get to have the warning for most of the code on
> newer gcc versions, but don't break older gcc versions that are still
> in common use.
Well it compiles when I do that at least with gcc 4.4, although obviously
it does mean -Wunsafe-loop-optimizations is disabled entirely for those
4 files rather than just for the one function that causes a problem.
--
Len Sorensen
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-22 18:41 ` Lennart Sorensen
@ 2012-02-22 19:00 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-22 22:50 ` Lennart Sorensen
0 siblings, 1 reply; 45+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-02-22 19:00 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 1249 bytes --]
On 22.02.2012 19:41, Lennart Sorensen wrote:
> On Wed, Feb 22, 2012 at 01:28:06PM -0500, Lennart Sorensen wrote:
>> Oh the feature for doing multiple #pragma statements throughout the code
>> is new in gcc 4.6. It can't be done in earlier versions. In older
>> versions whatever you say last applies to the whole file.
>>
>> Perhaps a slightly ugly solution could solve it by having a #if that
>> checks that gcc is 4.6 or higher around the #pragma that reenables
>> the warning.
>>
>> ie:
>>
>> #if __GNUC__> 4 || (__GNUC__ == 4&& __GNUC_MINOR__>= 6)
>> #pragma GCC diagnostic error "-Wunsafe-loop-optimizations"
>> #endif
>>
>> At least this way you get to have the warning for most of the code on
>> newer gcc versions, but don't break older gcc versions that are still
>> in common use.
> Well it compiles when I do that at least with gcc 4.4, although obviously
> it does mean -Wunsafe-loop-optimizations is disabled entirely for those
> 4 files rather than just for the one function that causes a problem.
Alternative is to add a condition which will ensure the loop termination
but don't interfere with it other wise by using the fact that min
(UINT_MAX, r)=r if r is unsigned int.
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: warn.diff --]
[-- Type: text/x-diff; name="warn.diff", Size: 11581 bytes --]
=== modified file 'conf/Makefile.common'
--- conf/Makefile.common 2012-02-22 15:27:39 +0000
+++ conf/Makefile.common 2012-02-22 17:26:03 +0000
@@ -104,7 +104,7 @@
CFLAGS_GCRY = -Wno-error -Wno-missing-field-initializers
CPPFLAGS_GCRY = -I$(top_srcdir)/grub-core/lib/libgcrypt_wrap
-CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition
+CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition -Wno-unsafe-loop-optimizations
CPPFLAGS_GNULIB = -I$(top_builddir)/grub-core/gnulib -I$(top_srcdir)/grub-core/gnulib
CFLAGS_POSIX = -fno-builtin
=== modified file 'configure.ac'
--- configure.ac 2012-02-22 03:56:45 +0000
+++ configure.ac 2012-02-22 16:51:06 +0000
@@ -377,9 +377,9 @@
LIBS=""
# debug flags.
-WARN_FLAGS="-Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
+WARN_FLAGS="-Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-parameter-type -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS"
-TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes"
+TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations"
TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g"
# Force no alignment to save space on i386.
=== modified file 'grub-core/commands/legacycfg.c'
--- grub-core/commands/legacycfg.c 2012-02-12 14:25:25 +0000
+++ grub-core/commands/legacycfg.c 2012-02-22 18:58:57 +0000
@@ -543,15 +543,17 @@
grub_uint8_t hash[MD5_HASHLEN];
};
+#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
+
static int
check_password_md5_real (const char *entered,
struct legacy_md5_password *pw)
{
- int enteredlen = grub_strlen (entered);
+ grub_size_t enteredlen = grub_strlen (entered);
unsigned char alt_result[MD5_HASHLEN];
unsigned char *digest;
grub_uint8_t ctx[GRUB_MD_MD5->contextsize];
- int i;
+ grub_size_t i;
GRUB_MD_MD5->init (ctx);
GRUB_MD_MD5->write (ctx, entered, enteredlen);
=== modified file 'grub-core/commands/testload.c'
--- grub-core/commands/testload.c 2012-02-22 04:04:54 +0000
+++ grub-core/commands/testload.c 2012-02-22 16:25:36 +0000
@@ -77,19 +77,24 @@
grub_printf ("Reading %s sequentially again", argv[0]);
grub_file_seek (file, 0);
- for (pos = 0; pos < size; pos += GRUB_DISK_SECTOR_SIZE)
+ for (pos = 0; pos < size;)
{
char sector[GRUB_DISK_SECTOR_SIZE];
-
- if (grub_file_read (file, sector, GRUB_DISK_SECTOR_SIZE)
- != GRUB_DISK_SECTOR_SIZE)
+ grub_size_t curlen = GRUB_DISK_SECTOR_SIZE;
+
+ if (curlen > size - pos)
+ curlen = size - pos;
+
+ if (grub_file_read (file, sector, curlen)
+ != (grub_ssize_t) curlen)
goto fail;
- if (grub_memcmp (sector, buf + pos, GRUB_DISK_SECTOR_SIZE) != 0)
+ if (grub_memcmp (sector, buf + pos, curlen) != 0)
{
grub_printf ("\nDiffers in %lld\n", (unsigned long long) pos);
goto fail;
}
+ pos += curlen;
}
grub_printf (" Done.\n");
=== modified file 'grub-core/disk/ldm.c'
--- grub-core/disk/ldm.c 2012-02-10 11:36:02 +0000
+++ grub-core/disk/ldm.c 2012-02-22 17:26:19 +0000
@@ -831,7 +831,7 @@
{
struct grub_diskfilter_pv *pv = NULL;
struct grub_diskfilter_vg *vg = NULL;
- struct grub_diskfilter_lv *res, *lv;
+ struct grub_diskfilter_lv *res = 0, *lv, *res_lv = 0;
pv = grub_diskfilter_get_pv_from_disk (disk, &vg);
@@ -844,19 +844,21 @@
&& lv->segments->nodes->pv == pv
&& lv->segments->nodes->start + pv->start_sector == start)
{
- res = lv;
+ res_lv = lv;
break;
}
+ if (!res_lv)
+ return NULL;
for (lv = vg->lvs; lv; lv = lv->next)
if (lv->segment_count == 1 && lv->segments->node_count == 1
&& lv->segments->type == GRUB_DISKFILTER_MIRROR
- && lv->segments->nodes->lv == lv)
+ && lv->segments->nodes->lv == res_lv)
{
res = lv;
break;
}
- if (res->fullname)
- return grub_strdup (lv->fullname);
+ if (res && res->fullname)
+ return grub_strdup (res->fullname);
return NULL;
}
=== modified file 'grub-core/fs/zfs/zfs_sha256.c'
--- grub-core/fs/zfs/zfs_sha256.c 2010-12-01 21:55:26 +0000
+++ grub-core/fs/zfs/zfs_sha256.c 2012-02-22 16:17:39 +0000
@@ -129,7 +129,7 @@
for (i = 0; i < 8; i++)
pad[padsize++] = (size << 3) >> (56 - 8 * i);
- for (i = 0; i < padsize; i += 64)
+ for (i = 0; i < padsize && i <= 64; i += 64)
SHA256Transform(H, pad + i);
zcp->zc_word[0] = grub_cpu_to_zfs64 ((grub_uint64_t)H[0] << 32 | H[1],
=== modified file 'grub-core/io/gzio.c'
--- grub-core/io/gzio.c 2012-02-12 14:25:25 +0000
+++ grub-core/io/gzio.c 2012-02-22 16:45:45 +0000
@@ -363,6 +363,8 @@
0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
};
+#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
+
#define NEEDBITS(n) do {while(k<(n)){b|=((ulg)get_byte(gzio))<<k;k+=8;}} while (0)
#define DUMPBITS(n) do {b>>=(n);k-=(n);} while (0)
=== modified file 'grub-core/lib/LzmaEnc.c'
--- grub-core/lib/LzmaEnc.c 2012-02-10 15:48:48 +0000
+++ grub-core/lib/LzmaEnc.c 2012-02-22 16:16:26 +0000
@@ -1211,7 +1211,7 @@
{
UInt32 i;
reps[0] = prevOpt->backs[pos];
- for (i = 1; i <= pos; i++)
+ for (i = 1; i < pos + 1; i++)
reps[i] = prevOpt->backs[i - 1];
for (; i < LZMA_NUM_REPS; i++)
reps[i] = prevOpt->backs[i];
=== modified file 'grub-core/net/net.c'
--- grub-core/net/net.c 2012-02-21 15:16:45 +0000
+++ grub-core/net/net.c 2012-02-22 18:55:00 +0000
@@ -608,8 +608,8 @@
struct grub_net_network_level_interface **interf)
{
struct grub_net_route *route;
- int depth = 0;
- int routecnt = 0;
+ unsigned int depth = 0;
+ unsigned int routecnt = 0;
struct grub_net_network_level_protocol *prot = NULL;
grub_net_network_level_address_t curtarget = addr;
@@ -618,7 +618,7 @@
FOR_NET_ROUTES(route)
routecnt++;
- for (depth = 0; depth < routecnt + 2; depth++)
+ for (depth = 0; depth < routecnt + 2 && depth < GRUB_UINT_MAX; depth++)
{
struct grub_net_route *bestroute = NULL;
FOR_NET_ROUTES(route)
=== modified file 'grub-core/normal/charset.c'
--- grub-core/normal/charset.c 2012-02-22 04:19:11 +0000
+++ grub-core/normal/charset.c 2012-02-22 18:57:27 +0000
@@ -734,7 +734,8 @@
{
int right_join = 0;
signed i;
- for (i = k - 1; i > (signed) line_start - 1; i--)
+ for (i = k - 1; i > (signed) line_start - 1 && i > GRUB_INT_MIN;
+ i--)
{
enum grub_join_type join_type = get_join_type (visual[i].base);
if (!(visual[i].attributes
=== modified file 'grub-core/normal/cmdline.c'
--- grub-core/normal/cmdline.c 2012-02-12 18:24:23 +0000
+++ grub-core/normal/cmdline.c 2012-02-22 16:21:47 +0000
@@ -49,13 +49,13 @@
/* Remove the lines that don't fit in the new buffer. */
if (newsize < hist_used)
{
- int i;
- int delsize = hist_used - newsize;
+ grub_size_t i;
+ grub_size_t delsize = hist_used - newsize;
hist_used = newsize;
- for (i = 1; i <= delsize; i++)
+ for (i = 1; i < delsize + 1; i++)
{
- int pos = hist_end - i;
+ grub_ssize_t pos = hist_end - i;
if (pos < 0)
pos += hist_size;
grub_free (old_hist_lines[pos]);
=== modified file 'grub-core/script/parser.y'
--- grub-core/script/parser.y 2012-02-10 15:48:48 +0000
+++ grub-core/script/parser.y 2012-02-22 17:31:45 +0000
@@ -31,6 +31,9 @@
#include "grub_script.tab.h"
#pragma GCC diagnostic ignored "-Wunreachable-code"
+#pragma GCC diagnostic ignored "-Wmissing-declarations"
+#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
+
%}
%union {
=== modified file 'grub-core/script/yylex.l'
--- grub-core/script/yylex.l 2012-02-03 10:56:49 +0000
+++ grub-core/script/yylex.l 2012-02-22 16:49:25 +0000
@@ -27,6 +27,8 @@
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
+#pragma GCC diagnostic ignored "-Wmissing-declarations"
+#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
#define yyfree grub_lexer_yyfree
#define yyalloc grub_lexer_yyalloc
=== modified file 'include/grub/types.h'
--- include/grub/types.h 2012-01-29 22:27:31 +0000
+++ include/grub/types.h 2012-02-22 18:56:02 +0000
@@ -124,6 +124,7 @@
#define GRUB_SHRT_MAX 0x7fff
#define GRUB_UINT_MAX 4294967295U
#define GRUB_INT_MAX 0x7fffffff
+#define GRUB_INT_MIN -0x80000000
#if GRUB_CPU_SIZEOF_LONG == 8
# define GRUB_ULONG_MAX 18446744073709551615UL
=== modified file 'util/grub-mkfont.c'
--- util/grub-mkfont.c 2012-02-10 12:31:43 +0000
+++ util/grub-mkfont.c 2012-02-22 18:56:38 +0000
@@ -717,7 +717,7 @@
bitmap = glyph->bitmap;
mask = 0x80;
- for (y = ymax - 1; y >= ymin; y--)
+ for (y = ymax - 1; y > ymin - 1 && y > GRUB_INT_MIN; y--)
{
int line_pos;
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-22 19:00 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-02-22 22:50 ` Lennart Sorensen
2012-02-22 23:03 ` Lennart Sorensen
0 siblings, 1 reply; 45+ messages in thread
From: Lennart Sorensen @ 2012-02-22 22:50 UTC (permalink / raw)
To: The development of GNU GRUB
On Wed, Feb 22, 2012 at 08:00:54PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> Alternative is to add a condition which will ensure the loop
> termination but don't interfere with it other wise by using the fact
> that min (UINT_MAX, r)=r if r is unsigned int.
>
>
> --
> Regards
> Vladimir 'φ-coder/phcoder' Serbinenko
>
> === modified file 'conf/Makefile.common'
> --- conf/Makefile.common 2012-02-22 15:27:39 +0000
> +++ conf/Makefile.common 2012-02-22 17:26:03 +0000
> @@ -104,7 +104,7 @@
> CFLAGS_GCRY = -Wno-error -Wno-missing-field-initializers
> CPPFLAGS_GCRY = -I$(top_srcdir)/grub-core/lib/libgcrypt_wrap
>
> -CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition
> +CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition -Wno-unsafe-loop-optimizations
> CPPFLAGS_GNULIB = -I$(top_builddir)/grub-core/gnulib -I$(top_srcdir)/grub-core/gnulib
>
> CFLAGS_POSIX = -fno-builtin
>
> === modified file 'configure.ac'
> --- configure.ac 2012-02-22 03:56:45 +0000
> +++ configure.ac 2012-02-22 16:51:06 +0000
> @@ -377,9 +377,9 @@
> LIBS=""
[snip]
Now I get:
gcc-4.6 -DHAVE_CONFIG_H -I. -I../../../grub-core -I.. -Wall -W -I../../../include -I../include -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -m32 -DGRUB_FILE=\"normal/charset.c\" -I. -I../../../grub-core -I.. -I../../.. -I../../../include -I../include -I../../../grub-core/lib/posix_wrap -Os -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-parameter-type -Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m32 -fno-stack-protector -Werror -Wno-trampolines -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1 -ffreestanding -fno-builtin -Wno-redundant-decls -c -o normal/normal_module-charset.o `test -f 'normal/charset.c' || echo '../../../grub-core/'`normal/charset.c
../../../grub-core/normal/charset.c: In function 'bidi_line_wrap':
../../../grub-core/normal/charset.c:737:55: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
cc1: all warnings being treated as errors
--
Len Sorensen
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-22 22:50 ` Lennart Sorensen
@ 2012-02-22 23:03 ` Lennart Sorensen
2012-02-23 2:39 ` Isaac Dupree
2012-02-23 6:17 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 2 replies; 45+ messages in thread
From: Lennart Sorensen @ 2012-02-22 23:03 UTC (permalink / raw)
To: The development of GNU GRUB
On Wed, Feb 22, 2012 at 05:50:37PM -0500, Lennart Sorensen wrote:
> Now I get:
>
> gcc-4.6 -DHAVE_CONFIG_H -I. -I../../../grub-core -I.. -Wall -W -I../../../include -I../include -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -m32 -DGRUB_FILE=\"normal/charset.c\" -I. -I../../../grub-core -I.. -I../../.. -I../../../include -I../include -I../../../grub-core/lib/posix_wrap -Os -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -W
> mudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-parameter-type -Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m32 -fno-stack-protector -Werror -Wno-trampolines -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1 -ffreestanding -fno-builtin -Wno-redundant-decls -c -o normal/normal_module-charset.o `test -f 'normal/charset.c' || echo '../../../grub-core/'`normal/charset.c
> ../../../grub-core/normal/charset.c: In function 'bidi_line_wrap':
> ../../../grub-core/normal/charset.c:737:55: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
> cc1: all warnings being treated as errors
For some reason the compiler thinks GRUB_INT_MIN which is defined as
-0x80000000 is unsigned.
If I do:
int right_join = 0;
signed i;
for (i = k - 1; i > (signed) line_start - 1 && i > (signed) GRUB_INT_MIN;
i--)
{
then gcc 4.6 stops complaining, but gcc 4.4 complains about:
gcc-4.4 -DHAVE_CONFIG_H -I. -I../../../grub-core -I.. -Wall -W -I../../../include -I../include -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -m32 -DGRUB_FILE=\"normal/charset.c\" -I. -I../../../grub-core -I.. -I../../.. -I../../../include -I../include -I../../../grub-core/lib/posix_wrap -Os -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-parameter-type -Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m32 -fno-stack-protector -Werror -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1 -ffreestanding -fno-builtin -Wno-redundant-decls -c -o normal/normal_module-charset.o `test -f 'normal/charset.c' || echo '../../../grub-core/'`normal/charset.c
cc1: warnings being treated as errors
../../../grub-core/normal/charset.c: In function 'grub_bidi_line_logical_to_visual':
../../../grub-core/normal/charset.c:737: error: cannot optimize possibly infinite loops
If I do what is already done for GRUB_LONG_MIN and use:
#define GRUB_INT_MIN (-0x7fffffff - 1)
...then gcc 4.6 is happy. gcc 4.4 goes on complaining about the inability
to optimize possibly infinite loops.
--
Len Sorensen
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-22 23:03 ` Lennart Sorensen
@ 2012-02-23 2:39 ` Isaac Dupree
2012-02-23 6:17 ` Vladimir 'φ-coder/phcoder' Serbinenko
1 sibling, 0 replies; 45+ messages in thread
From: Isaac Dupree @ 2012-02-23 2:39 UTC (permalink / raw)
To: grub-devel
On 02/22/2012 06:03 PM, Lennart Sorensen wrote:
> On Wed, Feb 22, 2012 at 05:50:37PM -0500, Lennart Sorensen wrote:
>> Now I get:
>>
>> gcc-4.6 -DHAVE_CONFIG_H -I. -I../../../grub-core -I.. -Wall -W -I../../../include -I../include -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -m32 -DGRUB_FILE=\"normal/charset.c\" -I. -I../../../grub-core -I.. -I../../.. -I../../../include -I../include -I../../../grub-core/lib/posix_wrap -Os -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-fo
rmat-attribute -Wmissing-noreturn -W
>> mudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-parameter-type -Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m32 -fno-stack-protector -Werror -Wno-trampolines -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1 -ffreestanding -fno-builtin -Wno-redundant-decls -c -o normal/normal_module-charset.o `test -f 'normal/charset.c' || echo '../../../grub-core/'`normal/charset.c
>> ../../../grub-core/normal/charset.c: In function 'bidi_line_wrap':
>> ../../../grub-core/normal/charset.c:737:55: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
>> cc1: all warnings being treated as errors
>
> For some reason the compiler thinks GRUB_INT_MIN which is defined as
> -0x80000000 is unsigned.
That's probably because "-0x80000000" *is* unsigned.
0x80000000 is an integer literal that does not fit into (32-bit) int but
does fit into (32-bit) unsigned int.
The negation operator does not change the signedness of its operand's type.
It should probably be signed, e.g.
#define GRUB_INT_MIN (-0x7fffffff - 1)
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-22 23:03 ` Lennart Sorensen
2012-02-23 2:39 ` Isaac Dupree
@ 2012-02-23 6:17 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-23 17:43 ` Lennart Sorensen
1 sibling, 1 reply; 45+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-02-23 6:17 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 611 bytes --]
>../../../grub-core/normal/charset.c: In function
'grub_bidi_line_logical_to_visual':
../../../grub-core/normal/charset.c:737: error: cannot optimize possibly
infinite
> loops If I do what is already done for GRUB_LONG_MIN and use: #define
GRUB_INT_MIN (-0x7fffffff - 1) ...then gcc 4.6 is happy. gcc 4.4 goes on
complaining
> about the inability to optimize possibly infinite loops.
in charset.c we actually want to ensure that it doesn't go negative. In
grub-mkfont.c it's ok to disable warning altogether. Here is the patch
(+grub-install fix)
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: warn+install.diff --]
[-- Type: text/x-diff; name="warn+install.diff", Size: 14307 bytes --]
=== modified file 'conf/Makefile.common'
--- conf/Makefile.common 2012-02-22 15:27:39 +0000
+++ conf/Makefile.common 2012-02-22 17:26:03 +0000
@@ -104,7 +104,7 @@
CFLAGS_GCRY = -Wno-error -Wno-missing-field-initializers
CPPFLAGS_GCRY = -I$(top_srcdir)/grub-core/lib/libgcrypt_wrap
-CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition
+CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition -Wno-unsafe-loop-optimizations
CPPFLAGS_GNULIB = -I$(top_builddir)/grub-core/gnulib -I$(top_srcdir)/grub-core/gnulib
CFLAGS_POSIX = -fno-builtin
=== modified file 'configure.ac'
--- configure.ac 2012-02-22 03:56:45 +0000
+++ configure.ac 2012-02-22 16:51:06 +0000
@@ -377,9 +377,9 @@
LIBS=""
# debug flags.
-WARN_FLAGS="-Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
+WARN_FLAGS="-Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-parameter-type -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS"
-TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes"
+TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations"
TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g"
# Force no alignment to save space on i386.
=== modified file 'grub-core/commands/legacycfg.c'
--- grub-core/commands/legacycfg.c 2012-02-12 14:25:25 +0000
+++ grub-core/commands/legacycfg.c 2012-02-22 18:58:57 +0000
@@ -543,15 +543,17 @@
grub_uint8_t hash[MD5_HASHLEN];
};
+#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
+
static int
check_password_md5_real (const char *entered,
struct legacy_md5_password *pw)
{
- int enteredlen = grub_strlen (entered);
+ grub_size_t enteredlen = grub_strlen (entered);
unsigned char alt_result[MD5_HASHLEN];
unsigned char *digest;
grub_uint8_t ctx[GRUB_MD_MD5->contextsize];
- int i;
+ grub_size_t i;
GRUB_MD_MD5->init (ctx);
GRUB_MD_MD5->write (ctx, entered, enteredlen);
=== modified file 'grub-core/commands/testload.c'
--- grub-core/commands/testload.c 2012-02-22 04:04:54 +0000
+++ grub-core/commands/testload.c 2012-02-22 16:25:36 +0000
@@ -77,19 +77,24 @@
grub_printf ("Reading %s sequentially again", argv[0]);
grub_file_seek (file, 0);
- for (pos = 0; pos < size; pos += GRUB_DISK_SECTOR_SIZE)
+ for (pos = 0; pos < size;)
{
char sector[GRUB_DISK_SECTOR_SIZE];
-
- if (grub_file_read (file, sector, GRUB_DISK_SECTOR_SIZE)
- != GRUB_DISK_SECTOR_SIZE)
+ grub_size_t curlen = GRUB_DISK_SECTOR_SIZE;
+
+ if (curlen > size - pos)
+ curlen = size - pos;
+
+ if (grub_file_read (file, sector, curlen)
+ != (grub_ssize_t) curlen)
goto fail;
- if (grub_memcmp (sector, buf + pos, GRUB_DISK_SECTOR_SIZE) != 0)
+ if (grub_memcmp (sector, buf + pos, curlen) != 0)
{
grub_printf ("\nDiffers in %lld\n", (unsigned long long) pos);
goto fail;
}
+ pos += curlen;
}
grub_printf (" Done.\n");
=== modified file 'grub-core/disk/diskfilter.c'
--- grub-core/disk/diskfilter.c 2012-02-12 14:25:25 +0000
+++ grub-core/disk/diskfilter.c 2012-02-23 05:42:14 +0000
@@ -972,35 +972,40 @@
: (pv->id.id == id->id))
{
struct grub_diskfilter_lv *lv;
+ grub_disk_t disk;
/* FIXME: Check whether the update time of the superblocks are
the same. */
+ disk = grub_disk_open (disk->name);
+ if (!disk)
+ return grub_errno;
+ if (disk && pv->disk && grub_disk_get_size (disk) >= pv->part_size)
+ {
+ grub_disk_close (disk);
+ return GRUB_ERR_NONE;
+ }
+ pv->disk = disk;
/* This could happen to LVM on RAID, pv->disk points to the
raid device, we shouldn't change it. */
- if (! pv->disk)
- {
- pv->disk = grub_disk_open (disk->name);
- if (! pv->disk)
- return grub_errno;
- pv->part_start = grub_partition_get_start (disk->partition);
- pv->part_size = grub_disk_get_size (disk);
+ pv->start_sector -= pv->part_start;
+ pv->part_start = grub_partition_get_start (disk->partition);
+ pv->part_size = grub_disk_get_size (disk);
#ifdef GRUB_UTIL
- {
- grub_size_t s = 1;
- grub_partition_t p;
- for (p = disk->partition; p; p = p->parent)
- s++;
- pv->partmaps = xmalloc (s * sizeof (pv->partmaps[0]));
- s = 0;
- for (p = disk->partition; p; p = p->parent)
- pv->partmaps[s++] = xstrdup (p->partmap->name);
- pv->partmaps[s++] = 0;
- }
+ {
+ grub_size_t s = 1;
+ grub_partition_t p;
+ for (p = disk->partition; p; p = p->parent)
+ s++;
+ pv->partmaps = xmalloc (s * sizeof (pv->partmaps[0]));
+ s = 0;
+ for (p = disk->partition; p; p = p->parent)
+ pv->partmaps[s++] = xstrdup (p->partmap->name);
+ pv->partmaps[s++] = 0;
+ }
#endif
- if (start_sector != (grub_uint64_t)-1)
- pv->start_sector = start_sector;
- pv->start_sector += pv->part_start;
- }
+ if (start_sector != (grub_uint64_t)-1)
+ pv->start_sector = start_sector;
+ pv->start_sector += pv->part_start;
/* Add the device to the array. */
for (lv = array->lvs; lv; lv = lv->next)
if (!lv->became_readable_at && lv->fullname && is_lv_readable (lv))
=== modified file 'grub-core/disk/ldm.c'
--- grub-core/disk/ldm.c 2012-02-10 11:36:02 +0000
+++ grub-core/disk/ldm.c 2012-02-22 17:26:19 +0000
@@ -831,7 +831,7 @@
{
struct grub_diskfilter_pv *pv = NULL;
struct grub_diskfilter_vg *vg = NULL;
- struct grub_diskfilter_lv *res, *lv;
+ struct grub_diskfilter_lv *res = 0, *lv, *res_lv = 0;
pv = grub_diskfilter_get_pv_from_disk (disk, &vg);
@@ -844,19 +844,21 @@
&& lv->segments->nodes->pv == pv
&& lv->segments->nodes->start + pv->start_sector == start)
{
- res = lv;
+ res_lv = lv;
break;
}
+ if (!res_lv)
+ return NULL;
for (lv = vg->lvs; lv; lv = lv->next)
if (lv->segment_count == 1 && lv->segments->node_count == 1
&& lv->segments->type == GRUB_DISKFILTER_MIRROR
- && lv->segments->nodes->lv == lv)
+ && lv->segments->nodes->lv == res_lv)
{
res = lv;
break;
}
- if (res->fullname)
- return grub_strdup (lv->fullname);
+ if (res && res->fullname)
+ return grub_strdup (res->fullname);
return NULL;
}
=== modified file 'grub-core/fs/zfs/zfs_sha256.c'
--- grub-core/fs/zfs/zfs_sha256.c 2010-12-01 21:55:26 +0000
+++ grub-core/fs/zfs/zfs_sha256.c 2012-02-22 16:17:39 +0000
@@ -129,7 +129,7 @@
for (i = 0; i < 8; i++)
pad[padsize++] = (size << 3) >> (56 - 8 * i);
- for (i = 0; i < padsize; i += 64)
+ for (i = 0; i < padsize && i <= 64; i += 64)
SHA256Transform(H, pad + i);
zcp->zc_word[0] = grub_cpu_to_zfs64 ((grub_uint64_t)H[0] << 32 | H[1],
=== modified file 'grub-core/io/gzio.c'
--- grub-core/io/gzio.c 2012-02-12 14:25:25 +0000
+++ grub-core/io/gzio.c 2012-02-22 16:45:45 +0000
@@ -363,6 +363,8 @@
0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
};
+#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
+
#define NEEDBITS(n) do {while(k<(n)){b|=((ulg)get_byte(gzio))<<k;k+=8;}} while (0)
#define DUMPBITS(n) do {b>>=(n);k-=(n);} while (0)
=== modified file 'grub-core/lib/LzmaEnc.c'
--- grub-core/lib/LzmaEnc.c 2012-02-10 15:48:48 +0000
+++ grub-core/lib/LzmaEnc.c 2012-02-22 16:16:26 +0000
@@ -1211,7 +1211,7 @@
{
UInt32 i;
reps[0] = prevOpt->backs[pos];
- for (i = 1; i <= pos; i++)
+ for (i = 1; i < pos + 1; i++)
reps[i] = prevOpt->backs[i - 1];
for (; i < LZMA_NUM_REPS; i++)
reps[i] = prevOpt->backs[i];
=== modified file 'grub-core/net/net.c'
--- grub-core/net/net.c 2012-02-21 15:16:45 +0000
+++ grub-core/net/net.c 2012-02-22 18:55:00 +0000
@@ -608,8 +608,8 @@
struct grub_net_network_level_interface **interf)
{
struct grub_net_route *route;
- int depth = 0;
- int routecnt = 0;
+ unsigned int depth = 0;
+ unsigned int routecnt = 0;
struct grub_net_network_level_protocol *prot = NULL;
grub_net_network_level_address_t curtarget = addr;
@@ -618,7 +618,7 @@
FOR_NET_ROUTES(route)
routecnt++;
- for (depth = 0; depth < routecnt + 2; depth++)
+ for (depth = 0; depth < routecnt + 2 && depth < GRUB_UINT_MAX; depth++)
{
struct grub_net_route *bestroute = NULL;
FOR_NET_ROUTES(route)
=== modified file 'grub-core/normal/charset.c'
--- grub-core/normal/charset.c 2012-02-22 04:19:11 +0000
+++ grub-core/normal/charset.c 2012-02-23 05:46:26 +0000
@@ -734,7 +734,8 @@
{
int right_join = 0;
signed i;
- for (i = k - 1; i > (signed) line_start - 1; i--)
+ for (i = k - 1; i > (signed) line_start - 1 && i >= 0;
+ i--)
{
enum grub_join_type join_type = get_join_type (visual[i].base);
if (!(visual[i].attributes
=== modified file 'grub-core/normal/cmdline.c'
--- grub-core/normal/cmdline.c 2012-02-12 18:24:23 +0000
+++ grub-core/normal/cmdline.c 2012-02-22 16:21:47 +0000
@@ -49,13 +49,13 @@
/* Remove the lines that don't fit in the new buffer. */
if (newsize < hist_used)
{
- int i;
- int delsize = hist_used - newsize;
+ grub_size_t i;
+ grub_size_t delsize = hist_used - newsize;
hist_used = newsize;
- for (i = 1; i <= delsize; i++)
+ for (i = 1; i < delsize + 1; i++)
{
- int pos = hist_end - i;
+ grub_ssize_t pos = hist_end - i;
if (pos < 0)
pos += hist_size;
grub_free (old_hist_lines[pos]);
=== modified file 'grub-core/script/parser.y'
--- grub-core/script/parser.y 2012-02-10 15:48:48 +0000
+++ grub-core/script/parser.y 2012-02-22 17:31:45 +0000
@@ -31,6 +31,9 @@
#include "grub_script.tab.h"
#pragma GCC diagnostic ignored "-Wunreachable-code"
+#pragma GCC diagnostic ignored "-Wmissing-declarations"
+#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
+
%}
%union {
=== modified file 'grub-core/script/yylex.l'
--- grub-core/script/yylex.l 2012-02-03 10:56:49 +0000
+++ grub-core/script/yylex.l 2012-02-22 16:49:25 +0000
@@ -27,6 +27,8 @@
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
+#pragma GCC diagnostic ignored "-Wmissing-declarations"
+#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
#define yyfree grub_lexer_yyfree
#define yyalloc grub_lexer_yyalloc
=== modified file 'util/grub-install.in'
--- util/grub-install.in 2012-02-10 17:16:27 +0000
+++ util/grub-install.in 2012-02-23 05:58:48 +0000
@@ -633,8 +633,8 @@
exit 1
fi
# Get the Open Firmware device tree path translation.
- dev="`echo $grub_device | sed -e 's/\/dev\///' -e 's/[0-9]\+//'`"
- partno="`echo $grub_device | sed -e 's/.*[^0-9]\([0-9]\+\)$/\1/'`"
+ dev="`echo $install_device | sed -e 's/\/dev\///' -e 's/[0-9]\+//'`"
+ partno="`echo $install_device | sed -e 's/.*[^0-9]\([0-9]\+\)$/\1/'`"
ofpath="`$ofpathname $dev`" || {
gettext_printf "Couldn't find IEEE1275 device tree path for %s.\nYou will have to set \`boot-device' variable manually.\n" "$dev" 1>&2
exit 1
=== modified file 'util/grub-mkfont.c'
--- util/grub-mkfont.c 2012-02-10 12:31:43 +0000
+++ util/grub-mkfont.c 2012-02-23 06:15:32 +0000
@@ -681,6 +681,8 @@
*offset += 10;
}
+#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
+
static void
print_glyphs (struct grub_font_info *font_info)
{
@@ -717,7 +719,7 @@
bitmap = glyph->bitmap;
mask = 0x80;
- for (y = ymax - 1; y >= ymin; y--)
+ for (y = ymax - 1; y > ymin - 1; y--)
{
int line_pos;
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Freeze on 27 February
2012-02-22 5:35 ` Freeze on 27 February Richard Laager
@ 2012-02-23 6:34 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-27 6:58 ` Richard Laager
` (2 more replies)
0 siblings, 3 replies; 45+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-02-23 6:34 UTC (permalink / raw)
To: Richard Laager; +Cc: The development of GRUB 2
On 22.02.2012 06:35, Richard Laager wrote:
> On Tue, 2012-02-21 at 17:12 +0100, Vladimir 'φ-coder/phcoder' Serbinenko
> wrote:
>> > @Richard Laager: Which of ZFS patches aren't committed yet? It's a bit
>> > tricky to see which ones were superseeded.
> I've attached my current patch set. The patches apply in the order
> listed. They're also roughly ordered by complexity, so I'd recommend
> reviewing them in this order.
>
> Also, if you have libzfs, a --disable-zfs or --without-zfs or similar
> patch is necessary to ensure that the zpool and zfs commands are used
> instead of libzfs.
>
> ---- Not ZFS Related:
>
> Previously submitted, no feedback, trivial:
> grub-install-whitespace.patch
>
> Not previously submitted, trivial:
> bzrignore-updates.patch
>
> ---- ZFS Related:
>
> Previously submitted, no feedback:
> zfs-poolname-spaces.patch
> zfs-devices.patch
>
> Not previously submitted:
> zfs-on-linux-rlaager8.patch
> With this, you should be able to boot with (native)
> ZFS-on-Linux, though you'll have to add whatever rpool
> specifiers (if any) required by your initrd.
>
> zfs-on-linux-rlaager9.patch
> Part of this is just to support ZFS roots
> (root=ZFS=rpool/ROOT/ubuntu, for example).
>
> The other part may need more design work. It moves some
> of the btrfs code to inside linux_entry (and likewise,
> the ZFS support is added there). Right now, GRUB
> supports the concept of multiple kernels. I think that
> needs to be extended to multiple root filesystems (in
> practice: subvols in btrfs, clones in ZFS). This is the
> first step in that process. The missing part is looping
> over the additional root filesystems.
>
> Even if we can't get the multiple root filesystems issue figured out,
> I'd really love to see everything else make it into the release. It'd be
> a huge step in the right direction for those of us working with native
> ZFS-on-Linux.
>
> -- Richard
>
>
> bzrignore-updates.patch
>
>
> === modified file '.bzrignore'
> Index: grub/.bzrignore
> ===================================================================
> --- grub.orig/.bzrignore 2012-02-04 17:30:15.295629000 -0600
> +++ grub/.bzrignore 2012-02-04 17:30:49.356454000 -0600
> @@ -104,6 +104,8 @@ partmap_test
> *.pp
> po/*.mo
> po/grub.pot
> +po/POTFILES
> +po/stamp-po
> stamp-h
> stamp-h1
> stamp-h.in
> @@ -132,8 +134,10 @@ contrib
> grub-core/Makefile.core.am
> grub-core/Makefile.gcry.def
> grub-core/contrib
> +grub-core/gdb_grub
> grub-core/genmod.sh
> grub-core/gensyminfo.sh
> +grub-core/gmodule.pl
> grub-core/modinfo.sh
> grub-core/*.module
> grub-core/*.pp
>
Committed
> zfs-poolname-spaces.patch
>
>
> Handle pool names with spaces
>
> Index: grub/util/getroot.c
> ===================================================================
> --- grub.orig/util/getroot.c 2012-02-03 05:21:06.838056692 -0600
> +++ grub/util/getroot.c 2012-02-03 05:22:36.227364000 -0600
> @@ -260,7 +260,7 @@
> char cksum[257], notes[257];
> unsigned int dummy;
>
> - cmd = xasprintf ("zpool status %s", poolname);
> + cmd = xasprintf ("zpool status \"%s\"", poolname);
> fp = popen (cmd, "r");
This is wrong if poolname contains weird characters. Can you make it
similar to mdadm-related code?
> free (cmd);
>
> @@ -285,8 +285,7 @@
> st++;
> break;
> case 1:
> - if (!strcmp (name, poolname))
> - st++;
> + st++;
> break;
> case 2:
> if (strcmp (name, "mirror")&& !sscanf (name, "mirror-%u",&dummy)
> @@ -420,6 +419,9 @@
> if (sscanf (sep, "%s %s", entry.fstype, entry.device) != 2)
> continue;
>
> + unescape (entry.fstype);
> + unescape (entry.device);
> +
You need to increase the size of storage for these fields.
>
> Handle vdevs with full paths
>
> Index: grub/util/getroot.c
> ===================================================================
> --- grub.orig/util/getroot.c 2012-02-03 05:22:36.227364000 -0600
> +++ grub/util/getroot.c 2012-02-03 05:22:41.255135000 -0600
> @@ -301,7 +301,10 @@
> devices = xrealloc (devices, sizeof (devices[0])
> * devices_allocated);
> }
> - devices[ndevices++] = xasprintf ("/dev/%s", name);
> + if (name[0] == '/')
> + devices[ndevices++] = xstrdup (name);
> + else
> + devices[ndevices++] = xasprintf ("/dev/%s", name);
> }
> break;
> }
>
This one is ok other than the missing ChangeLog.
> zfs-on-linux-rlaager8.patch
>
>
> ZFS on Linux Improvements
>
> 1. `zpool status` can output disk names which are under /dev/disk.
> 2. `zpool status` outputs the whole disk device for wholedisk pools,
> but GRUB needs the partition device.
> 3. Support native ZFS on Linux.
>
> Index: grub/util/getroot.c
> ===================================================================
> --- grub.orig/util/getroot.c 2012-02-03 05:54:39.540539000 -0600
> +++ grub/util/getroot.c 2012-02-03 06:04:29.465275000 -0600
> @@ -304,7 +304,87 @@
> if (name[0] == '/')
> devices[ndevices++] = xstrdup (name);
> else
> +#ifdef __linux__
> + {
> + /* The name returned by zpool isn't necessarily directly under /dev. */
> + char *device = xasprintf ("/dev/%s", name);
Could you unify this with the scan code we already have? (the one where
we scan for major/minor)
@@ -478,7 +558,8 @@
if (!*entries[i].device)
continue;
- if (grub_strcmp (entries[i].fstype, "fuse.zfs") == 0)
+ if (grub_strcmp (entries[i].fstype, "fuse.zfs") == 0 ||
+ grub_strcmp (entries[i].fstype, "zfs") == 0)
{
char *slash;
slash = strchr (entries[i].device, '/');
This should go as a separate patch
>
> zfs-on-linux-rlaager9.patch
>
>
> Pass boot=zfs and zfs-bootfs=... when / is ZFS on Linux
>
> Index: grub/util/grub.d/10_linux.in
> ===================================================================
> --- grub.orig/util/grub.d/10_linux.in 2012-02-02 03:34:48.512644650 -0600
> +++ grub/util/grub.d/10_linux.in 2012-02-03 01:12:57.608355000 -0600
> @@ -56,13 +56,11 @@
> LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
> fi
>
> -if [ "x`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`" = xbtrfs ] \
> - || [ "x`stat -f --printf=%T /`" = xbtrfs ]; then
> - rootsubvol="`make_system_path_relative_to_its_root /`"
> - rootsubvol="${rootsubvol#/}"
> - if [ "x${rootsubvol}" != x ]; then
> - GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
> - fi
> +LINUX_ROOT_FS=`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`
> +LINUX_ROOT_STAT=`stat -f --printf=%T / || true`
> +
> +if [ "x${LINUX_ROOT_FS}" = xzfs ]; then
> + RPOOL=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true`
> fi
>
> for word in $GRUB_CMDLINE_LINUX_DEFAULT; do
> @@ -193,6 +191,19 @@
> version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
> alt_version=`echo $version | sed -e "s,\.old$,,g"`
> linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
> + cmdline=""
> + if [ "x${LINUX_ROOT_FS}" = xbtrfs -o "x${LINUX_ROOT_STAT}" = xbtrfs ]; then
> + rootsubvol="`make_system_path_relative_to_its_root /`"
> + rootsubvol="${rootsubvol#/}"
> + if [ "x${rootsubvol}" != x ]; then
> + cmdline="rootflags=subvol=${rootsubvol} ${cmdline}"
> + fi
> + fi
> + if [ "x${LINUX_ROOT_FS}" = xzfs ]; then
> + bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`"
> + linux_root_device_thisversion="ZFS=${RPOOL}${bootfs}"
> + cmdline="boot=zfs rpool=${RPOOL} bootfs=${RPOOL}${bootfs} ${cmdline}"
> + fi
Please keep this at the beginning, we don't need to execute it for every
kernel.
>
> initrd=
> for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \
> @@ -229,7 +240,7 @@
> fi
>
> linux_entry "${OS}" "${version}" false \
> - "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_EXTRA} ${GRUB_CMDLINE_LINUX_DEFAULT}" \
> + "${cmdline} ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_EXTRA} ${GRUB_CMDLINE_LINUX_DEFAULT}" \
> quiet
> if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
> if [ -x /lib/recovery-mode/recovery-menu ]; then
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-23 6:17 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-02-23 17:43 ` Lennart Sorensen
2012-02-24 23:16 ` Lennart Sorensen
0 siblings, 1 reply; 45+ messages in thread
From: Lennart Sorensen @ 2012-02-23 17:43 UTC (permalink / raw)
To: The development of GNU GRUB
On Thu, Feb 23, 2012 at 07:17:49AM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> >../../../grub-core/normal/charset.c: In function
> 'grub_bidi_line_logical_to_visual':
> ../../../grub-core/normal/charset.c:737: error: cannot optimize
> possibly infinite
> > loops If I do what is already done for GRUB_LONG_MIN and use:
> #define GRUB_INT_MIN (-0x7fffffff - 1) ...then gcc 4.6 is happy. gcc
> 4.4 goes on complaining
> > about the inability to optimize possibly infinite loops.
> in charset.c we actually want to ensure that it doesn't go negative.
> In grub-mkfont.c it's ok to disable warning altogether. Here is the
> patch (+grub-install fix)
gcc-4.6 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"grub-core/disk/diskfilter.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I./grub-core/gnulib -I../../grub-core/gnulib -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-parameter-type -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Werror -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition -Wno-unsafe-loop-optimizations -c -o grub-core/disk/libgrubkern_a-diskfilter.o `test -f 'grub-core/disk/diskfilter.c' || echo '../../'`grub-core/disk/diskfilter.c
../../grub-core/disk/diskfilter.c: In function 'insert_array':
../../grub-core/disk/diskfilter.c:975:14: error: declaration of 'disk' shadows a parameter [-Werror=shadow]
../../grub-core/disk/diskfilter.c:953:27: error: shadowed declaration is here [-Werror=shadow]
--
Len Sorensen
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Lists and aliasing (Re: Freeze on 27 February)
2012-02-23 17:43 ` Lennart Sorensen
@ 2012-02-24 23:16 ` Lennart Sorensen
0 siblings, 0 replies; 45+ messages in thread
From: Lennart Sorensen @ 2012-02-24 23:16 UTC (permalink / raw)
To: The development of GNU GRUB
On Thu, Feb 23, 2012 at 12:43:08PM -0500, Lennart Sorensen wrote:
> gcc-4.6 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\" -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -DGRUB_FILE=\"grub-core/disk/diskfilter.c\" -I. -I../.. -I. -I../.. -I../../include -I./include -I./grub-core/gnulib -I../../grub-core/gnulib -g -Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-ini
> tializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-parameter-type -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Werror -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition -Wno-unsafe-loop-optimizations -c -o grub-core/disk/libgrubkern_a-diskfilter.o `test -f 'grub-core/disk/diskfilter.c' || echo '../../'`grub-core/disk/diskfilter.c
> ../../grub-core/disk/diskfilter.c: In function 'insert_array':
> ../../grub-core/disk/diskfilter.c:975:14: error: declaration of 'disk' shadows a parameter [-Werror=shadow]
> ../../grub-core/disk/diskfilter.c:953:27: error: shadowed declaration is here [-Werror=shadow]
OK just as an update, with a current bzr checkout I get:
gcc-4.4 -DHAVE_CONFIG_H -I. -I../../../grub-core -I.. -Wall -W -I../../../include -I../include -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -m32 -DGRUB_FILE=\"normal/charset.c\" -I. -I../../../grub-core -I.. -I../../.. -I../../../include -I../include -I../../../grub-core/lib/posix_wrap -Os -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-parameter-type -Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m32 -fno-stack-protector -Werror -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1 -ffreestanding -fno-builtin -Wno-redundant-decls -c -o normal/normal_module-charset.o `test -f 'normal/charset.c' || echo '../../../grub-core/'`normal/charset.c
cc1: warnings being treated as errors
../../../grub-core/normal/charset.c: In function 'grub_bidi_line_logical_to_visual':
../../../grub-core/normal/charset.c:737: error: cannot optimize possibly infinite loops
--
Len Sorensen
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Freeze on 27 February
2012-02-23 6:34 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-02-27 6:58 ` Richard Laager
2012-02-27 18:17 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-27 7:32 ` Richard Laager
[not found] ` <1330033617.3895.26.camel@watermelon.coderich.net>
2 siblings, 1 reply; 45+ messages in thread
From: Richard Laager @ 2012-02-27 6:58 UTC (permalink / raw)
To: Vladimir 'φ-coder/phcoder' Serbinenko
Cc: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 629 bytes --]
On Thu, 2012-02-23 at 07:34 +0100, Vladimir 'φ-coder/phcoder' Serbinenko
wrote:
> > zfs-poolname-spaces.patch
> ...
> > @@ -420,6 +419,9 @@
> > if (sscanf (sep, "%s %s", entry.fstype, entry.device) != 2)
> > continue;
> >
> > + unescape (entry.fstype);
> > + unescape (entry.device);
> > +
> You need to increase the size of storage for these fields.
On second look... why? The unescape() function modifies the string in
place, and it changes multi-character escape sequences into single
unescaped characters. I don't understand how this would change the size
requirement.
--
Richard
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Freeze on 27 February
2012-02-23 6:34 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-27 6:58 ` Richard Laager
@ 2012-02-27 7:32 ` Richard Laager
[not found] ` <1330033617.3895.26.camel@watermelon.coderich.net>
2 siblings, 0 replies; 45+ messages in thread
From: Richard Laager @ 2012-02-27 7:32 UTC (permalink / raw)
To: Vladimir 'φ-coder/phcoder' Serbinenko
Cc: The development of GRUB 2
[-- Attachment #1.1: Type: text/plain, Size: 1244 bytes --]
On Thu, 2012-02-23 at 07:34 +0100, Vladimir 'φ-coder/phcoder' Serbinenko
wrote:
> > Index: grub/util/getroot.c
> > ===================================================================
> > --- grub.orig/util/getroot.c 2012-02-03 05:22:36.227364000 -0600
> > +++ grub/util/getroot.c 2012-02-03 05:22:41.255135000 -0600
> > @@ -301,7 +301,10 @@
> > devices = xrealloc (devices, sizeof (devices[0])
> > * devices_allocated);
> > }
> > - devices[ndevices++] = xasprintf ("/dev/%s", name);
> > + if (name[0] == '/')
> > + devices[ndevices++] = xstrdup (name);
> > + else
> > + devices[ndevices++] = xasprintf ("/dev/%s", name);
> > }
> > break;
> > }
> >
> This one is ok other than the missing ChangeLog.
Updated zfs-devices.patch attached
> @@ -478,7 +558,8 @@
> if (!*entries[i].device)
> continue;
>
> - if (grub_strcmp (entries[i].fstype, "fuse.zfs") == 0)
> + if (grub_strcmp (entries[i].fstype, "fuse.zfs") == 0 ||
> + grub_strcmp (entries[i].fstype, "zfs") == 0)
> {
> char *slash;
> slash = strchr (entries[i].device, '/');
> This should go as a separate patch
Attached as zfs-fstype.patch.
--
Richard
[-- Attachment #1.2: zfs-devices.patch --]
[-- Type: text/x-patch, Size: 992 bytes --]
Index: grub/util/getroot.c
===================================================================
--- grub.orig/util/getroot.c 2012-02-27 01:09:58.142614829 -0600
+++ grub/util/getroot.c 2012-02-27 01:10:07.237344000 -0600
@@ -302,7 +302,10 @@ find_root_devices_from_poolname (char *p
devices = xrealloc (devices, sizeof (devices[0])
* devices_allocated);
}
- devices[ndevices++] = xasprintf ("/dev/%s", name);
+ if (name[0] == '/')
+ devices[ndevices++] = xstrdup (name);
+ else
+ devices[ndevices++] = xasprintf ("/dev/%s", name);
}
break;
}
Index: grub/ChangeLog.zfs-devices
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ grub/ChangeLog.zfs-devices 2012-02-27 01:20:10.839892000 -0600
@@ -0,0 +1,5 @@
+2012-02-27 Richard Laager <rlaager@wiktel.com>
+
+ * util/getroot.c (find_root_devices_from_poolname): Handle ZFS vdevs
+ with full paths.
+
[-- Attachment #1.3: zfs-fstype.patch --]
[-- Type: text/x-patch, Size: 1027 bytes --]
Support native ZFS on Linux.
Index: grub/util/getroot.c
===================================================================
--- grub.orig/util/getroot.c 2012-02-27 01:10:07.237344000 -0600
+++ grub/util/getroot.c 2012-02-27 01:24:13.693145000 -0600
@@ -479,7 +479,8 @@ grub_find_root_devices_from_mountinfo (c
if (!*entries[i].device)
continue;
- if (grub_strcmp (entries[i].fstype, "fuse.zfs") == 0)
+ if (grub_strcmp (entries[i].fstype, "fuse.zfs") == 0 ||
+ grub_strcmp (entries[i].fstype, "zfs") == 0)
{
char *slash;
slash = strchr (entries[i].device, '/');
Index: grub/ChangeLog.zfs-fstype
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ grub/ChangeLog.zfs-fstype 2012-02-27 01:26:20.548958000 -0600
@@ -0,0 +1,5 @@
+2012-02-27 Richard Laager <rlaager@wiktel.com>
+
+ * util/getroot.c (grub_find_root_devices_from_mountinfo): Support
+ the native ZFS on Linux fstype ("zfs").
+
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Freeze on 27 February
2012-02-27 6:58 ` Richard Laager
@ 2012-02-27 18:17 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 0 replies; 45+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-02-27 18:17 UTC (permalink / raw)
To: Richard Laager; +Cc: The development of GRUB 2
On 27.02.2012 07:58, Richard Laager wrote:
> On Thu, 2012-02-23 at 07:34 +0100, Vladimir 'φ-coder/phcoder' Serbinenko
> wrote:
>>> zfs-poolname-spaces.patch
>> ...
>>> @@ -420,6 +419,9 @@
>>> if (sscanf (sep, "%s %s", entry.fstype, entry.device) != 2)
>>> continue;
>>>
>>> + unescape (entry.fstype);
>>> + unescape (entry.device);
>>> +
>> You need to increase the size of storage for these fields.
> On second look... why?
It turns out that the sizes were already increased. Just that PATH_MAX
refers to unescaped length, original can be substantially larger.
> The unescape() function modifies the string in
> place, and it changes multi-character escape sequences into single
> unescaped characters. I don't understand how this would change the size
> requirement.
>
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Freeze on 27 February
[not found] ` <1330322681.2901.8.camel@watermelon.coderich.net>
@ 2012-02-27 18:18 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 0 replies; 45+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-02-27 18:18 UTC (permalink / raw)
To: Richard Laager, The development of GRUB 2
On 27.02.2012 07:04, Richard Laager wrote:
> On Mon, 2012-02-27 at 00:01 -0600, Richard Laager wrote:
>> I haven't verified that the kernel itself refuses to create/load
>> such a pool.
> In any case, what is the threat here? If someone hand-crafts such a
> pool, they still have to get the administrator to import it.
>
> Even if the system is automatically importing pools, they'd still have
> to have physical access to, for example, plug in a USB device with the
> evil pool.
A USB stick "forgotten" in a public place can do wonders.
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Freeze on 27 February
[not found] ` <1330322499.2901.5.camel@watermelon.coderich.net>
[not found] ` <1330322681.2901.8.camel@watermelon.coderich.net>
@ 2012-02-27 18:20 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-27 19:46 ` Richard Laager
1 sibling, 1 reply; 45+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-02-27 18:20 UTC (permalink / raw)
To: Richard Laager, The development of GRUB 2
On 27.02.2012 07:01, Richard Laager wrote:
> On Mon, 2012-02-27 at 01:00 +0100, Vladimir 'φ-coder/phcoder' Serbinenko
> wrote:
>>> The allowed characters are: [a-zA-Z0-9_.: -]
>> This isn't a good enough argument. One could purposedly create a pool
>> named `rm -rf /*` even though it's incorrect.
> By "allowed characters", I meant that the normal ZFS stack will not
> permit you to create a pool using characters outside that range. That
> said, I haven't verified that the kernel itself refuses to create/load
> such a pool.
I've rewritten this code. I've also committed most of your changes
except the one adding the tree scanning when we already have one
>
> The patch I proposed is no worse than the code that's already in GRUB.
> Given the impending freeze and the fact that I'm on vacation, can you
> apply it and I'll come back to this issue later? I've CC'ed myself so I
> don't forget.
>
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Freeze on 27 February
2012-02-27 18:20 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-02-27 19:46 ` Richard Laager
2012-03-08 22:51 ` Remaining ZFS Changes for 2.00 (Was: Re: Freeze on 27 February) Richard Laager
0 siblings, 1 reply; 45+ messages in thread
From: Richard Laager @ 2012-02-27 19:46 UTC (permalink / raw)
To: Vladimir 'φ-coder/phcoder' Serbinenko
Cc: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 422 bytes --]
On Mon, 2012-02-27 at 19:20 +0100, Vladimir 'φ-coder/phcoder' Serbinenko
wrote:
> I've rewritten this code. I've also committed most of your changes
> except the one adding the tree scanning when we already have one
Thanks. I'll catch up on this after my vacation and submit whatever
updated patches remain necessary. Obviously, they won't make this
release, but I'll work towards the next one.
--
Richard
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 45+ messages in thread
* Remaining ZFS Changes for 2.00 (Was: Re: Freeze on 27 February)
2012-02-27 19:46 ` Richard Laager
@ 2012-03-08 22:51 ` Richard Laager
2012-03-10 12:44 ` Vladimir 'φ-coder/phcoder' Serbinenko
` (3 more replies)
0 siblings, 4 replies; 45+ messages in thread
From: Richard Laager @ 2012-03-08 22:51 UTC (permalink / raw)
To: Vladimir 'φ-coder/phcoder' Serbinenko
Cc: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 3391 bytes --]
I've rebased my patch sets against BZR revision 4144 and tested. Aside
from the device scanning code (which you wanted me to implement
differently) and the Ubuntu-specific recordfail patch, the following two
changes are all that's left:
---------------------------------------------------------------------
IMHO, the following change should be committed before the next release.
The code currently in BZR does not actually set the RPOOL variable.
Also, I don't think we should be adding rpool= or bootfs= to the Linux
command-line. I had those in my patch set for compatibility with the
existing initramfs on my system. I wasn't intending to propose those for
upstream inclusion. If GRUB 2.00 is released with them, then initrds
might start using them, which would mean GRUB would have to support them
for a long time.
The same applies to boot=zfs. The initrd code should be updated to parse
the root=ZFS=rpool/bootfs syntax. Or, if the distro wants/needs
something else, they can patch GRUB and/or have the admin set the
appropriate flags in GRUB_CMDLINE_LINUX in /etc/default/grub.
Supporting just the root=ZFS=rpool/bootfs syntax in an initrd is not
difficult. On Ubuntu, it's a two-line patch to initramfs-tools (to
eliminate the need for boot=zfs) and a ~10 line patch to zfs-initramfs
(to support root=ZFS=rpool/bootfs). (The patches are
backwards-compatible.) Considering other implementations... The systemd
ZFS code is already using the root=ZFS=rpool/bootfs syntax, so it
shouldn't require any changes. Gentoo is using something very similar, I
believe, so the changes there should be minimal.
Index: grub/util/grub.d/10_linux.in
===================================================================
--- grub.orig/util/grub.d/10_linux.in 2012-03-08 14:06:00.641410243 -0600
+++ grub/util/grub.d/10_linux.in 2012-03-08 15:30:53.557993000 -0600
@@ -61,9 +61,9 @@ case x"$GRUBFS" in
GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
fi;;
xzfs)
+ rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true`
bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`"
- LINUX_ROOT_DEVICE="ZFS=${RPOOL}${bootfs}"
- GRUB_CMDLINE_LINUX="boot=zfs rpool=${RPOOL} bootfs=${RPOOL}${bootfs} ${cmdline} ${GRUB_CMDLINE_LINUX}";;
+ LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs}"
esac
title_correction_code=
---------------------------------------------------------------------
I believe the following change is still needed to support pool names
with spaces. That said, maybe we shouldn't care about pool names with
spaces. If a pool name has spaces, then we need some way to escape it
when building the linux_entry command line. Then the initrd needs to
unescape it. That seems like a lot of hassle for a configuration that's
likely to be extremely uncommon even if GRUB does support it.
Index: grub/util/getroot.c
===================================================================
--- grub.orig/util/getroot.c 2012-02-03 05:21:06.838056692 -0600
+++ grub/util/getroot.c 2012-02-03 05:22:36.227364000 -0600
@@ -285,8 +285,7 @@
st++;
break;
case 1:
- if (!strcmp (name, poolname))
- st++;
+ st++;
break;
case 2:
if (strcmp (name, "mirror") && !sscanf (name, "mirror-%u", &dummy)
--
Richard
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Remaining ZFS Changes for 2.00 (Was: Re: Freeze on 27 February)
2012-03-08 22:51 ` Remaining ZFS Changes for 2.00 (Was: Re: Freeze on 27 February) Richard Laager
@ 2012-03-10 12:44 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-03-10 13:39 ` Vladimir 'φ-coder/phcoder' Serbinenko
` (2 subsequent siblings)
3 siblings, 0 replies; 45+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-03-10 12:44 UTC (permalink / raw)
To: Richard Laager; +Cc: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 698 bytes --]
On 08.03.2012 23:51, Richard Laager wrote:
> I believe the following change is still needed to support pool names
> with spaces. That said, maybe we shouldn't care about pool names with
> spaces. If a pool name has spaces, then we need some way to escape it
> when building the linux_entry command line.
HAve you tried simply putting single quotes around it
> Then the initrd needs to
> unescape it.
If it uses /proc/cmdline then yes. If it gets arguments from init then
it wouldn't be a problem.
> That seems like a lot of hassle for a configuration that's
> likely to be extremely uncommon even if GRUB does support it.
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Remaining ZFS Changes for 2.00 (Was: Re: Freeze on 27 February)
2012-03-08 22:51 ` Remaining ZFS Changes for 2.00 (Was: Re: Freeze on 27 February) Richard Laager
2012-03-10 12:44 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-03-10 13:39 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-03-10 15:51 ` Richard Laager
2012-03-10 13:41 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-03-10 17:51 ` Vladimir 'φ-coder/phcoder' Serbinenko
3 siblings, 1 reply; 45+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-03-10 13:39 UTC (permalink / raw)
To: Richard Laager; +Cc: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 1112 bytes --]
On 08.03.2012 23:51, Richard Laager wrote:
> I've rebased my patch sets against BZR revision 4144 and tested. Aside
>
> Index: grub/util/grub.d/10_linux.in
> ===================================================================
> --- grub.orig/util/grub.d/10_linux.in 2012-03-08 14:06:00.641410243 -0600
> +++ grub/util/grub.d/10_linux.in 2012-03-08 15:30:53.557993000 -0600
> @@ -61,9 +61,9 @@ case x"$GRUBFS" in
> GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
> fi;;
> xzfs)
> + rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true`
> bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`"
> - LINUX_ROOT_DEVICE="ZFS=${RPOOL}${bootfs}"
> - GRUB_CMDLINE_LINUX="boot=zfs rpool=${RPOOL} bootfs=${RPOOL}${bootfs} ${cmdline} ${GRUB_CMDLINE_LINUX}";;
> + LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs}"
> esac
>
> title_correction_code=
>
Please, don't forget xen counterpart in the future. It's not the first
time I have to fix your patches for them
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Remaining ZFS Changes for 2.00 (Was: Re: Freeze on 27 February)
2012-03-08 22:51 ` Remaining ZFS Changes for 2.00 (Was: Re: Freeze on 27 February) Richard Laager
2012-03-10 12:44 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-03-10 13:39 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-03-10 13:41 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-03-10 17:51 ` Vladimir 'φ-coder/phcoder' Serbinenko
3 siblings, 0 replies; 45+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-03-10 13:41 UTC (permalink / raw)
To: Richard Laager; +Cc: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 1160 bytes --]
On 08.03.2012 23:51, Richard Laager wrote:
> Index: grub/util/grub.d/10_linux.in
> ===================================================================
> --- grub.orig/util/grub.d/10_linux.in 2012-03-08 14:06:00.641410243 -0600
> +++ grub/util/grub.d/10_linux.in 2012-03-08 15:30:53.557993000 -0600
> @@ -61,9 +61,9 @@ case x"$GRUBFS" in
> GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
> fi;;
> xzfs)
> + rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true`
> bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`"
> - LINUX_ROOT_DEVICE="ZFS=${RPOOL}${bootfs}"
> - GRUB_CMDLINE_LINUX="boot=zfs rpool=${RPOOL} bootfs=${RPOOL}${bootfs} ${cmdline} ${GRUB_CMDLINE_LINUX}";;
> + LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs}"
> esac
>
> title_correction_code=
And test your patches, please, in particular this one contains a syntax
error (missing ;;). It would take much more time for me to evaluate your
patches if I presuppose that you haven't even tested them as I can
conclude from this patch.
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Remaining ZFS Changes for 2.00 (Was: Re: Freeze on 27 February)
2012-03-10 13:39 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-03-10 15:51 ` Richard Laager
2012-03-10 16:01 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 45+ messages in thread
From: Richard Laager @ 2012-03-10 15:51 UTC (permalink / raw)
To: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 330 bytes --]
On Sat, 2012-03-10 at 14:39 +0100, Vladimir 'φ-coder/phcoder' Serbinenko
wrote:
> Please, don't forget xen counterpart in the future. It's not the first
> time I have to fix your patches for them
I didn't realize the Linux code was duplicated for Xen. That seems
sub-optimal. Can that be avoided somehow?
--
Richard
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Remaining ZFS Changes for 2.00 (Was: Re: Freeze on 27 February)
2012-03-10 15:51 ` Richard Laager
@ 2012-03-10 16:01 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 0 replies; 45+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-03-10 16:01 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 656 bytes --]
On 10.03.2012 16:51, Richard Laager wrote:
> On Sat, 2012-03-10 at 14:39 +0100, Vladimir 'φ-coder/phcoder' Serbinenko
> wrote:
>> Please, don't forget xen counterpart in the future. It's not the first
>> time I have to fix your patches for them
> I didn't realize the Linux code was duplicated for Xen. That seems
> sub-optimal. Can that be avoided somehow?
Yes, it can be moved to some common file but not during the freeze.
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
^ permalink raw reply [flat|nested] 45+ messages in thread
* Re: Remaining ZFS Changes for 2.00 (Was: Re: Freeze on 27 February)
2012-03-08 22:51 ` Remaining ZFS Changes for 2.00 (Was: Re: Freeze on 27 February) Richard Laager
` (2 preceding siblings ...)
2012-03-10 13:41 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-03-10 17:51 ` Vladimir 'φ-coder/phcoder' Serbinenko
3 siblings, 0 replies; 45+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-03-10 17:51 UTC (permalink / raw)
To: Richard Laager; +Cc: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 1206 bytes --]
On 08.03.2012 23:51, Richard Laager wrote:
> I believe the following change is still needed to support pool names
> with spaces. That said, maybe we shouldn't care about pool names with
> spaces. If a pool name has spaces, then we need some way to escape it
> when building the linux_entry command line. Then the initrd needs to
> unescape it. That seems like a lot of hassle for a configuration that's
> likely to be extremely uncommon even if GRUB does support it.
>
> Index: grub/util/getroot.c
> ===================================================================
> --- grub.orig/util/getroot.c 2012-02-03 05:21:06.838056692 -0600
> +++ grub/util/getroot.c 2012-02-03 05:22:36.227364000 -0600
> @@ -285,8 +285,7 @@
> st++;
> break;
> case 1:
> - if (!strcmp (name, poolname))
> - st++;
> + st++;
>
The root cause of the problem is that sscanf on the top of this loop is
improper way to parse strings with spaces so probably this will create
more problems e.g. if for some reason we have an extra empty line. Also
if a space is present if member devices e're back to the same problem.
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
^ permalink raw reply [flat|nested] 45+ messages in thread
end of thread, other threads:[~2012-03-10 17:51 UTC | newest]
Thread overview: 45+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-21 16:12 Freeze on 27 February Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-21 16:19 ` Lennart Sorensen
2012-02-21 17:09 ` Lists and aliasing (Re: Freeze on 27 February) Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-21 18:46 ` Lennart Sorensen
2012-02-21 19:58 ` Lennart Sorensen
2012-02-21 20:29 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-22 15:34 ` Lennart Sorensen
2012-02-22 15:50 ` Lennart Sorensen
2012-02-22 15:57 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-22 16:18 ` Lennart Sorensen
2012-02-22 16:25 ` Lennart Sorensen
2012-02-22 16:43 ` Lennart Sorensen
2012-02-22 16:50 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-22 17:16 ` Lennart Sorensen
2012-02-22 17:35 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-22 17:41 ` Lennart Sorensen
2012-02-22 17:46 ` Lennart Sorensen
2012-02-22 18:01 ` Lennart Sorensen
2012-02-22 18:28 ` Lennart Sorensen
2012-02-22 18:41 ` Lennart Sorensen
2012-02-22 19:00 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-22 22:50 ` Lennart Sorensen
2012-02-22 23:03 ` Lennart Sorensen
2012-02-23 2:39 ` Isaac Dupree
2012-02-23 6:17 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-23 17:43 ` Lennart Sorensen
2012-02-24 23:16 ` Lennart Sorensen
2012-02-22 17:38 ` Lennart Sorensen
2012-02-22 16:51 ` Lennart Sorensen
2012-02-21 21:40 ` Lennart Sorensen
2012-02-22 5:35 ` Freeze on 27 February Richard Laager
2012-02-23 6:34 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-27 6:58 ` Richard Laager
2012-02-27 18:17 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-27 7:32 ` Richard Laager
[not found] ` <1330033617.3895.26.camel@watermelon.coderich.net>
[not found] ` <4F4AC782.1090402@gmail.com>
[not found] ` <1330322499.2901.5.camel@watermelon.coderich.net>
[not found] ` <1330322681.2901.8.camel@watermelon.coderich.net>
2012-02-27 18:18 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-27 18:20 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-27 19:46 ` Richard Laager
2012-03-08 22:51 ` Remaining ZFS Changes for 2.00 (Was: Re: Freeze on 27 February) Richard Laager
2012-03-10 12:44 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-03-10 13:39 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-03-10 15:51 ` Richard Laager
2012-03-10 16:01 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-03-10 13:41 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-03-10 17:51 ` Vladimir 'φ-coder/phcoder' Serbinenko
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.