Freeze on 27 February
Subsystems (3)
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.
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 8 lines · Vladimir 'φ-coder/phcoder' Serbinenko
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.
Signature · 1 line
Len Sorensen
Lists and aliasing (Re: Freeze on 27 February)
Quoted 9 lines · Lennart Sorensen
Quoted 8 lines · Vladimir 'φ-coder/phcoder' Serbinenko
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.
Quoted 7 lines
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
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
=== modified file 'grub-core/kern/list.c'
kern/list.c +21 -0
@@ -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'
grub/list.h +2 -20
@@ -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)
Re: Lists and aliasing (Re: Freeze on 27 February)
Quoted 59 lines · Vladimir 'φ-coder/phcoder' Serbinenko
Try attached patch
Signature · 5 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko === modified file 'grub-core/kern/list.c'kern/list.c +21
-0@@ -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'grub/list.h +0
-15@@ -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;
grub/list.h line 38
Quoted 10 lines
grub/list.h +2
-5-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.
Signature · 1 line
Len Sorensen
Re: Lists and aliasing (Re: Freeze on 27 February)
Quoted 6 lines · Lennart Sorensen
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.
Signature · 1 line
Len Sorensen
Re: Lists and aliasing (Re: Freeze on 27 February)
Quoted 10 lines · Lennart Sorensen
Quoted 6 lines · Lennart Sorensen
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.
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
configure.ac +1 -1
@@ -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"
grub-core/commands/testload.c +4 -1
@@ -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);
grub-core/fs/affs.c +1 -1
@@ -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,
grub-core/kern/corecmd.c +1 -1
@@ -128,7 +128,7 @@else {char *device_name; -grub_device_t dev; +grub_device_t dev =0 ;grub_fs_t fs;char *path;
grub-core/kern/disk.c +2 -2
@@ -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; } }
grub-core/kern/emu/hostdisk.c +3 -2
@@ -1145,8 +1145,9 @@int lineno =0 ;struct stat st; - autovoid show_error (const char *msg); -void show_error (const char *msg) + autovoid 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); }
grub-core/kern/list.c +21 -0
@@ -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 ; +}
grub-core/lib/pbkdf2.c +3 -3
@@ -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 ;
grub-core/lib/xzembed/xz_dec_bcj.c +1 -1
@@ -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 ;
grub-core/net/net.c +3 -3
@@ -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)
grub-core/normal/charset.c +3 -3
@@ -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
grub-core/normal/cmdline.c +4 -4
@@ -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]);
include/grub/list.h +2 -20
@@ -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)
Makefile.util.def +1 -1
@@ -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;
util/bin2h.c +1 -1
@@ -31,7 +31,7 @@ {0, 0, 0, 0 } }; -static void +static void __attribute__ ((noreturn))usage (int status) {if (status)
Re: Lists and aliasing (Re: Freeze on 27 February)
Quoted 16 lines · Vladimir 'φ-coder/phcoder' Serbinenko
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
configure.ac +1
-1@@ -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.cmainline-mod/grub-core/commands/testload.c
grub-core/commands/testload.c line 104
Quoted 6 lines
grub-core/commands/testload.c +2
-1@@ -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.
Signature · 1 line
Len Sorensen
Re: Lists and aliasing (Re: Freeze on 27 February)
Quoted 9 lines · Lennart Sorensen
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 -ogrub-core/disk/libgrubkern_a-ldm.otest -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 functionI 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.
Signature · 1 line
Len Sorensen
Re: Lists and aliasing (Re: Freeze on 27 February)
Quoted 6 lines
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_shortand_option_is_endinargp.hwhich leaves 99 warnings for gcc 4.4 and 73 for gcc 4.6.
Hm we don't add -Wmissing-prototypes for utils
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
Re: Lists and aliasing (Re: Freeze on 27 February)
Quoted 8 lines · Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 6 lines
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_shortand_option_is_endinargp.hwhich 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.
Signature · 1 line
Len Sorensen
Re: Lists and aliasing (Re: Freeze on 27 February)
Quoted 11 lines · Lennart Sorensen
Well it is in
WARN_FLAGSandTARGET_CFLAGSin 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 -outil/grub_mkimage-grub-mkimage.otest -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.
Signature · 1 line
Len Sorensen
Re: Lists and aliasing (Re: Freeze on 27 February)
Quoted 11 lines · Lennart Sorensen
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_FLAGSit gets set twice inTARGET_CFLAGSand also set once inHOST_CFLAGS. Perhaps that was not meant to be in there and should only have been inTARGET_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?
Signature · 1 line
Len Sorensen
Re: Lists and aliasing (Re: Freeze on 27 February)
In reply to Lennart SorensenQuoted 23 lines · Lennart Sorensen
Quoted 11 lines · Lennart Sorensen
Well it is in
WARN_FLAGSandTARGET_CFLAGSin 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 -outil/grub_mkimage-grub-mkimage.otest -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_FLAGSit gets set twice inTARGET_CFLAGSand also set once inHOST_CFLAGS. Perhaps that was not meant to be in there and should only have been inTARGET_CFLAGS.
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
=== modified file 'conf/Makefile.common'
Makefile.common +1 -1
@@ -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 +1 -1
@@ -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'
commands/legacycfg.c +2 -2
@@ -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'
commands/testload.c +10 -5
@@ -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'
disk/ldm.c +7 -5
@@ -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'
fs/zfs/zfs_sha256.c +1 -1
@@ -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'
io/gzio.c +2 -0
@@ -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'
lib/LzmaEnc.c +1 -1
@@ -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'
normal/cmdline.c +4 -4
@@ -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'
script/parser.y +1 -0
@@ -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'
script/yylex.l +2 -0
@@ -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'
grub-mkfont.c +1 -1
@@ -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;
Re: Lists and aliasing (Re: Freeze on 27 February)
Quoted 17 lines · Vladimir 'φ-coder/phcoder' Serbinenko
=== modified file 'conf/Makefile.common'
Makefile.common +1
-1@@ -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 line 383
Quoted 8 lines
configure.ac +1
-1@@ -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.
Signature · 1 line
Len Sorensen
Re: Lists and aliasing (Re: Freeze on 27 February)
Quoted 1 line
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
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
=== modified file 'conf/Makefile.common'
Makefile.common +1 -1
@@ -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 +2 -2
@@ -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'
commands/legacycfg.c +6 -2
@@ -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'
commands/testload.c +10 -5
@@ -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'
disk/ldm.c +7 -5
@@ -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'
fs/zfs/zfs_sha256.c +1 -1
@@ -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'
io/gzio.c +2 -0
@@ -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'
lib/LzmaEnc.c +1 -1
@@ -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'
net/net.c +4 -0
@@ -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'
normal/charset.c +3 -0
@@ -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'
normal/cmdline.c +4 -4
@@ -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'
script/parser.y +3 -0
@@ -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'
script/yylex.l +2 -0
@@ -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'
grub-mkfont.c +5 -1
@@ -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) {
Re: Lists and aliasing (Re: Freeze on 27 February)
Quoted 5 lines · Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 1 line
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.
Signature · 1 line
Len Sorensen
Re: Lists and aliasing (Re: Freeze on 27 February)
Quoted 10 lines · Lennart Sorensen
Quoted 5 lines · Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 1 line
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-errorOh 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.
Signature · 1 line
Len Sorensen
Re: Lists and aliasing (Re: Freeze on 27 February)
Quoted 8 lines · Lennart Sorensen
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 -outil/grub_mkfont-grub-mkfont.otest -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 loopsThat was unexpected. --disable-werror didn't prevent that from failing.
gcc 4.6 on the other hand now seems to compile with -Werror enabled.
Signature · 1 line
Len Sorensen
Re: Lists and aliasing (Re: Freeze on 27 February)
Quoted 1 line · Lennart Sorensen
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.
Signature · 1 line
Len Sorensen
Re: Lists and aliasing (Re: Freeze on 27 February)
Quoted 10 lines · Lennart Sorensen
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:
Quoted 7 lines
#if
__GNUC__> 4 || (__GNUC__== 4 &&__GNUC_MINOR__>= 6) #pragma GCC diagnostic error "-Wunsafe-loop-optimizations" #endifAt 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.
Signature · 1 line
Len Sorensen
Re: Lists and aliasing (Re: Freeze on 27 February)
Quoted 15 lines · Lennart Sorensen
Quoted 14 lines · Lennart Sorensen
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
Quoted 6 lines
Quoted 3 lines
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.
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
=== modified file 'conf/Makefile.common'
Makefile.common +1 -1
@@ -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 +2 -2
@@ -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'
commands/legacycfg.c +4 -2
@@ -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'
commands/testload.c +10 -5
@@ -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'
disk/ldm.c +7 -5
@@ -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'
fs/zfs/zfs_sha256.c +1 -1
@@ -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'
io/gzio.c +2 -0
@@ -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'
lib/LzmaEnc.c +1 -1
@@ -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'
net/net.c +3 -3
@@ -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'
normal/charset.c +2 -1
@@ -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'
normal/cmdline.c +4 -4
@@ -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'
script/parser.y +3 -0
@@ -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'
script/yylex.l +2 -0
@@ -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'
grub/types.h +1 -0
@@ -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'
grub-mkfont.c +1 -1
@@ -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;
Re: Lists and aliasing (Re: Freeze on 27 February)
Quoted 27 lines · Vladimir 'φ-coder/phcoder' Serbinenko
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.Signature · 5 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko === modified file 'conf/Makefile.common'Makefile.common +1
-1@@ -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 line 377
Quoted 1 line
configure.ac +0
-0@@ -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
Signature · 1 line
Len Sorensen
Re: Lists and aliasing (Re: Freeze on 27 February)
Quoted 7 lines · Lennart Sorensen
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 -onormal/normal_module-charset.otest -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.
Signature · 1 line
Len Sorensen
Re: Lists and aliasing (Re: Freeze on 27 February)
Quoted 4 lines · Lennart Sorensen
Quoted 3 lines · Lennart Sorensen
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
Quoted 7 lines
Quoted 4 lines
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.otest -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 errorsFor some reason the compiler thinks
GRUB_INT_MINwhich 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)
Re: Lists and aliasing (Re: Freeze on 27 February)
In reply to Lennart SorensenQuoted 3 lines
../../../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 forGRUB_LONG_MINand use: #defineGRUB_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)
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
=== modified file 'conf/Makefile.common'
Makefile.common +1 -1
@@ -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 +2 -2
@@ -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'
commands/legacycfg.c +4 -2
@@ -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'
commands/testload.c +10 -5
@@ -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'
disk/diskfilter.c +27 -22
62 lines not on this page · raw message
=== modified file 'grub-core/disk/ldm.c'
disk/ldm.c +7 -5
@@ -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'
fs/zfs/zfs_sha256.c +1 -1
@@ -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'
io/gzio.c +2 -0
@@ -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'
lib/LzmaEnc.c +1 -1
@@ -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'
net/net.c +3 -3
@@ -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'
normal/charset.c +2 -1
@@ -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'
normal/cmdline.c +4 -4
@@ -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'
script/parser.y +3 -0
@@ -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'
script/yylex.l +2 -0
@@ -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'
grub-install.in +2 -2
@@ -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'
grub-mkfont.c +3 -1
@@ -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;
Re: Lists and aliasing (Re: Freeze on 27 February)
Quoted 11 lines · Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 1 line
../../../grub-core/normal/charset.c: In function'
grub_bidi_line_logical_to_visual':../../../grub-core/normal/charset.c:737: error: cannot optimize possibly infiniteQuoted 1 line
loops If I do what is already done for
GRUB_LONG_MINand use:#define
GRUB_INT_MIN(-0x7fffffff - 1) ...then gcc 4.6 is happy. gcc 4.4 goes on complainingQuoted 1 line
about the inability to optimize possibly infinite loops.
in
charset.cwe actually want to ensure that it doesn't go negative. Ingrub-mkfont.cit'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]
Signature · 1 line
Len Sorensen
Re: Lists and aliasing (Re: Freeze on 27 February)
Quoted 5 lines · Lennart Sorensen
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 -ogrub-core/disk/libgrubkern_a-diskfilter.otest -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
Signature · 1 line
Len Sorensen
Re: Lists and aliasing (Re: Freeze on 27 February)
In reply to Lennart SorensenQuoted 8 lines · Lennart Sorensen
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
Signature · 1 line
Len Sorensen
Re: Lists and aliasing (Re: Freeze on 27 February)
In reply to Lennart SorensenQuoted 11 lines · Lennart Sorensen
Quoted 8 lines · Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 6 lines
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_shortand_option_is_endinargp.hwhich 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_FLAGSandTARGET_CFLAGSin 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 <[email protected]>
* 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).
Signature · 1 line
Len Sorensen
Re: Lists and aliasing (Re: Freeze on 27 February)
In reply to Lennart SorensenQuoted 2 lines · 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.
Signature · 1 line
Len Sorensen
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]
Quoted 2 lines · Vladimir 'φ-coder/phcoder' Serbinenko
@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.
Signature · 1 line
Richard
ChangeLog.grub-install-whitespace new file +4 -0
@@ -0,0 +1,4 @@ +2012-02-03 Richard Laager <[email protected]> + + * util/grub-install.in: Fix some inconsistent whitespace. +
util/grub-install.in +7 -7
@@ -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).
=== modified file '.bzrignore'
.bzrignore +4 -0
@@ -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
Handle pool names with spaces
util/getroot.c +5 -3
@@ -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
Handle vdevs with full paths
util/getroot.c +4 -1
@@ -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 ; }
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.
util/getroot.c +82 -1
96 lines not on this page · raw message
Pass boot=zfs and zfs-bootfs=... when / is ZFS on Linux
util/grub.d/10_linux.in +19 -8
@@ -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
Quoted 72 lines · Richard Laager
Quoted 2 lines · Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 2 lines
@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.patchNot previously submitted, trivial:
bzrignore-updates.patch---- ZFS Related:
Previously submitted, no feedback:
zfs-poolname-spaces.patch
zfs-devices.patchNot 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
===================================================================.bzrignore +2
-0@@ -104,6 +104,8 @@ partmap_test *.pp po/*.mo po/grub.pot +po/POTFILES +po/stamp-po stamp-h stamp-h1 stamp-h.in
.bzrignore contrib · line 143
Quoted 10 lines
.bzrignore +2
-0@@ -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
Quoted 10 lines
zfs-poolname-spaces.patch
Handle pool names with spaces
Index:
grub/util/getroot.c
===================================================================
util/getroot.c line 264
Quoted 6 lines
util/getroot.c +1
-1@@ -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?
Quoted 13 lines
util/getroot.c +1
-2free (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)
util/getroot.c line 424
Quoted 6 lines
util/getroot.c +3
-0@@ -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.
Quoted 10 lines
Handle vdevs with full paths
Index:
grub/util/getroot.c
===================================================================util/getroot.c +0
-0@@ -301,7 +301,10 @@ devices = xrealloc (devices, sizeof (devices[0])
util/getroot.c line 310
Quoted 10 lines
util/getroot.c +4
-1* 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.
Quoted 15 lines
zfs-on-linux-rlaager8.patch
ZFS on Linux Improvements
1.
zpool statuscan output disk names which are under/dev/disk.
2.zpool statusoutputs the whole disk device for wholedisk pools, but GRUB needs the partition device.
3. Support native ZFS on Linux.Index:
grub/util/getroot.c
===================================================================
util/getroot.c line 310
Quoted 7 lines
util/getroot.c +4
-0@@ -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
Quoted 36 lines
zfs-on-linux-rlaager9.patch
Pass boot=zfs and zfs-bootfs=... when / is ZFS on Linux
Index: grub/util/grub.d/10_linux.in
===================================================================util/grub.d/10_linux.in +8
-7@@ -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 /`"
util/grub.d/10_linux.in line 206
Quoted 10 lines
util/grub.d/10_linux.in +10
-0+ 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.
Quoted 12 lines
util/grub.d/10_linux.in +1
-1initrd= 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
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 10 lines · Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 1 line
zfs-poolname-spaces.patch
...
util/getroot.c line 424
Quoted 7 lines
util/getroot.c +3
-0@@ -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.
Signature · 1 line
Richard
Quoted 8 lines · Richard Laager
Quoted 6 lines · Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 1 line
zfs-poolname-spaces.patch
...
Quoted 4 lines
util/getroot.c +0
-0@@ -420,6 +419,9 @@if (sscanf (sep,"%s %s" , entry.fstype, entry.device) !=2 )continue ;
Quoted 5 lines
Quoted 4 lines
util/getroot.c line 424
Quoted 3 lines
util/getroot.c +3
-0+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.
Quoted 5 lines
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.
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 10 lines · Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 10 lines
Index:
grub/util/getroot.c
===================================================================util/getroot.c +1
-1@@ -301,7 +301,10 @@ devices =xrealloc (devices,sizeof (devices[0 ]) * devices_allocated); } - devices[ndevices++] =xasprintf ("/dev/%s" , name); +if (name[0 ] =='/' )
Quoted 8 lines
util/getroot.c line 310
Quoted 7 lines
util/getroot.c +3
-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
Quoted 11 lines
(quoted diff) +2
-1@@ -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.
Signature · 1 line
Richard
util/getroot.c +4 -1
@@ -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 ; }
ChangeLog.zfs-devices new file +5 -0
@@ -0,0 +1,5 @@ +2012-02-27 Richard Laager <[email protected]> + + * util/getroot.c (find_root_devices_from_poolname): Handle ZFS vdevs + with full paths. +
Support native ZFS on Linux.
util/getroot.c +2 -1
@@ -479,7 +479,8 @@ grub_find_root_devices_from_mountinfo (cif (!*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,'/' );
ChangeLog.zfs-fstype new file +5 -0
@@ -0,0 +1,5 @@ +2012-02-27 Richard Laager <[email protected]> + + * util/getroot.c (grub_find_root_devices_from_mountinfo): Support + the native ZFS on Linux fstype ("zfs"). +
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 9 lines · Richard Laager
Quoted 2 lines · Richard Laager
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.
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 9 lines · Richard Laager
Quoted 3 lines · Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 1 line
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
Quoted 6 lines
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.
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 2 lines · Vladimir 'φ-coder/phcoder' Serbinenko
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.
Signature · 1 line
Richard
Remaining ZFS Changes for 2.00 (Was: Re: Freeze on 27 February)
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.
util/grub.d/10_linux.in +2 -2
@@ -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.
util/getroot.c +1 -2
@@ -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)
Signature · 1 line
Richard
Re: Remaining ZFS Changes for 2.00 (Was: Re: Freeze on 27 February)
Quoted 4 lines · Richard Laager
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_entrycommand line.
HAve you tried simply putting single quotes around it
Quoted 2 lines
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.
Quoted 2 lines
That seems like a lot of hassle for a configuration that's
likely to be extremely uncommon even if GRUB does support it.
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
Re: Remaining ZFS Changes for 2.00 (Was: Re: Freeze on 27 February)
In reply to Richard LaagerQuoted 9 lines · Richard Laager
I've rebased my patch sets against BZR revision 4144 and tested. Aside
Index: grub/util/grub.d/10_linux.in
===================================================================util/grub.d/10_linux.in +0
-0@@ -61,9 +61,9 @@ case x"$GRUBFS" in GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
util/grub.d/10_linux.in case x"$GRUBFS" in · line 69
Quoted 10 lines
util/grub.d/10_linux.in +2
-2fi;; 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
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
Re: Remaining ZFS Changes for 2.00 (Was: Re: Freeze on 27 February)
Quoted 2 lines · Vladimir 'φ-coder/phcoder' Serbinenko
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?
Signature · 1 line
Richard
Re: Remaining ZFS Changes for 2.00 (Was: Re: Freeze on 27 February)
Quoted 6 lines · Richard Laager
Quoted 2 lines · Vladimir 'φ-coder/phcoder' Serbinenko
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.
Quoted 6 lines
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
Re: Remaining ZFS Changes for 2.00 (Was: Re: Freeze on 27 February)
In reply to Richard LaagerQuoted 6 lines · Richard Laager
Index: grub/util/grub.d/10_linux.in
===================================================================util/grub.d/10_linux.in +0
-0@@ -61,9 +61,9 @@ case x"$GRUBFS" in GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
util/grub.d/10_linux.in case x"$GRUBFS" in · line 69
Quoted 10 lines
util/grub.d/10_linux.in +2
-2fi;; 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.
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
Re: Remaining ZFS Changes for 2.00 (Was: Re: Freeze on 27 February)
In reply to Richard LaagerQuoted 12 lines · Richard Laager
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_entrycommand 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
===================================================================
util/getroot.c line 289
Quoted 7 lines
util/getroot.c +1
-2@@ -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.
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko