[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Lists and aliasing (Re: Freeze on 27 February)
From: |
Lennart Sorensen |
Subject: |
Re: Lists and aliasing (Re: Freeze on 27 February) |
Date: |
Tue, 21 Feb 2012 13:46:27 -0500 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Tue, Feb 21, 2012 at 06:09:36PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko
wrote:
> Try attached patch
>
>
> --
> Regards
> Vladimir 'φ-coder/phcoder' Serbinenko
>
> === modified file 'grub-core/kern/list.c'
> --- grub-core/kern/list.c 2012-02-12 02:52:17 +0000
> +++ grub-core/kern/list.c 2012-02-12 02:52:48 +0000
> @@ -32,3 +32,24 @@
>
> return NULL;
> }
> +
> +void
> +grub_list_push (grub_list_t *head, grub_list_t item)
> +{
> + item->prev = head;
> + if (*head)
> + (*head)->prev = &item->next;
> + item->next = *head;
> + *head = item;
> +}
> +
> +void
> +grub_list_remove (grub_list_t item)
> +{
> + if (item->prev)
> + *item->prev = item->next;
> + if (item->next)
> + item->next->prev = item->prev;
> + item->next = 0;
> + item->prev = 0;
> +}
>
> === modified file 'include/grub/list.h'
> --- include/grub/list.h 2012-02-12 02:52:17 +0000
> +++ include/grub/list.h 2012-02-12 02:53:20 +0000
> @@ -31,26 +31,8 @@
> };
> typedef struct grub_list *grub_list_t;
>
> -static inline void
> -grub_list_push (grub_list_t *head, grub_list_t item)
> -{
> - item->prev = head;
> - if (*head)
> - (*head)->prev = &item->next;
> - item->next = *head;
> - *head = item;
> -}
> -
> -static inline void
> -grub_list_remove (grub_list_t item)
> -{
> - if (item->prev)
> - *item->prev = item->next;
> - if (item->next)
> - item->next->prev = item->prev;
> - item->next = 0;
> - item->prev = 0;
> -}
> +void EXPORT_FUNC(grub_list_push) (grub_list_t *head, grub_list_t item);
> +void EXPORT_FUNC(grub_list_remove) (grub_list_t item);
>
> #define FOR_LIST_ELEMENTS(var, list) for ((var) = (list); (var); (var) =
> (var)->next)
>
That actually seems to have done it. I am still trying to wrap my head
around why that made a difference since it appears to be identical code
moved somewhere else. It isn't inlined anymore, but should that make
a big difference?
Only 509 warnings left (down from 5000 or so).
Any patches for:
gcc-4.4 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1
-DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\"
-DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1
-DGRUB_FILE=\"grub-core/lib/pbkdf2.c\" -I. -I../.. -I. -
I../.. -I../../include -I./include -I./grub-core/gnulib
-I../../grub-core/gnulib -g -Wall -O2 -Wall -W -Wshadow
-Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra
-Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined
-Wcast-align -Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch
-Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero
-Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul
-Wformat-extra-args -Wformat-security -Wformat-y2k -Wigno
red-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int
-Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations
-Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers
-Wmissing-format-attribute -Wmissing-noreturn -Wmudflap
-Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses
-Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow
-Wsign-compare -Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand
-Wtrigraphs -Wtype-limits -Wundef -Wuninitialize
d -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function
-Wunused-label -Wunused-parameter -Wunused-result -Wunused-value
-Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings
-Wmissing-declarations -Wmissing-parameter-type -Wmissing-prot
otypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Wno-undef
-Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls
-Wno-unreachable-code -Wno-conversion -Wno-old-style-definition
-c -o grub-core/lib/libgrubkern_a-pbkdf2.o `test
-f 'grub-core/lib/pbkdf2.c' || echo '../../'`grub-core/lib/pbkdf2.c
../../grub-core/lib/pbkdf2.c: In function 'grub_crypto_pbkdf2':
../../grub-core/lib/pbkdf2.c:77: warning: cannot optimize possibly infinite
loops
../../grub-core/lib/pbkdf2.c:73: warning: cannot optimize possibly infinite
loops
gcc-4.4 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1
-DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\"
-DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1
-DGRUB_FILE=\"grub-core/disk/ldm.c\" -I. -I../.. -I. -I../.. -I../../include
-I./include -I./grub-core/gnulib -I../../grub-core/gnulib -g
-Wall -O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition
-Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes
-Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment
-Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations
-Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal
-Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k
-Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int
-Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations
-Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers
-Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull
-Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith
-Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare
-Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs
-Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code
-Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result
-Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var
-Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type
-Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign
-Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter
-Wno-redundant-decls -Wno-unreachable-code -Wno-conversion
-Wno-old-style-definition -c -o
grub-core/disk/libgrubkern_a-ldm.o `test -f 'grub-core/disk/ldm.c' || echo
'../../'`grub-core/disk/ldm.c
../../grub-core/disk/ldm.c: In function 'grub_util_get_ldm':
../../grub-core/disk/ldm.c:834: warning: 'res' may be used uninitialized in
this function
gcc-4.4 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1
-DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\"
-DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1
-DGRUB_FILE=\"grub-core/commands/testload.c\" -I. -I../.. -I. -I../..
-I../../include -I./include -I../../grub-core/lib/minilzo
-I../../grub-core/lib/xzembed -DMINILZO_HAVE_CONFIG_H -g -Wall
-O2 -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition
-Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes
-Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment
-Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations
-Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal
-Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k
-Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int
-Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations
-Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers
-Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull
-Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith
-Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare
-Wstack-protector -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs
-Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code
-Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result
-Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var
-Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type
-Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign
-fno-builtin -Wno-undef -c -o
grub-core/commands/libgrubmods_a-testload.o `test -f
'grub-core/commands/testload.c' || echo '../../'`grub-core/commands/testload.c
../../grub-core/commands/testload.c: In function 'grub_cmd_testload':
../../grub-core/commands/testload.c:99: warning: cannot optimize loop, the loop
counter may overflow
../../grub-core/commands/testload.c:80: warning: cannot optimize loop, the loop
counter may overflow
gcc-4.4 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1
-DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\"
-DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1
-DGRUB_FILE=\"grub-core/fs/affs.c\" -I. -I../.. -I. -I../.. -I../../include
-I./include -I../../grub-core/lib/minilzo -I../../grub-core/lib/xzembed
-DMINILZO_HAVE_CONFIG_H -g -Wall -O2 -Wall -W -Wshadow
-Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra
-Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align
-Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated
-Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body
-Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args
-Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit
-Wimplicit-function-declaration -Wimplicit-int -Winit-self
-Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op
-Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute
-Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow
-Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast
-Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector
-Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef
-Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function
-Wunused-label -Wunused-parameter -Wunused-result -Wunused-value
-Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings
-Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes
-Wnested-externs -Wstrict-prototypes -Wpointer-sign -fno-builtin -Wno-undef
-c -o grub-core/fs/libgrubmods_a-affs.o `test -f
'grub-core/fs/affs.c' || echo '../../'`grub-core/fs/affs.c
../../grub-core/fs/affs.c: In function 'grub_affs_read_block':
../../grub-core/fs/affs.c:146: warning: cannot optimize possibly infinite loops
gcc-4.4 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=1
-DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\"
-DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1
-DGRUB_FILE=\"grub-core/fs/cpio_be.c\" -I. -I../.. -I. -I../.. -I../../include
-I./include -I../../grub-core/lib/minilzo -I../../grub-core/lib/xzembed
-DMINILZO_HAVE_CONFIG_H -g -Wall -O2 -Wall -W -Wshadow
-Wold-style-declaration -Wold-style-definition -Wpointer-arith -Wundef -Wextra
-Waddress -Warray-bounds -Wattributes -Wbuiltin-macro-redefined -Wcast-align
-Wchar-subscripts -Wclobbered -Wcomment -Wcoverage-mismatch -Wdeprecated
-Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body
-Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args
-Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimplicit
-Wimplicit-function-declaration -Wimplicit-int -Winit-self
-Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op
-Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute
-Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull -Woverflow
-Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-to-int-cast
-Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstack-protector
-Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits -Wundef
-Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function
-Wunused-label -Wunused-parameter -Wunused-result -Wunused-value
-Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings
-Wmissing-declarations -Wmissing-parameter-type -Wmissing-prototypes
-Wnested-externs -Wstrict-prototypes -Wpointer-sign -fno-builtin -Wno-undef
-c -o grub-core/fs/libgrubmods_a-cpio_be.o `test -f
'grub-core/fs/cpio_be.c' || echo '../../'`grub-core/fs/cpio_be.c
In file included from ../../grub-core/fs/cpio_be.c:2:
../../grub-core/fs/cpio.c: In function 'grub_cpio_find_file':
../../grub-core/fs/cpio.c:187: warning: will never be executed
../../grub-core/fs/cpio.c:187: warning: will never be executed
../../grub-core/fs/cpio.c:187: warning: will never be executed
../../grub-core/fs/cpio.c:187: warning: will never be executed
and many more.
I can include a complete build log again if you want.
--
Len Sorensen
- Freeze on 27 February, Vladimir 'φ-coder/phcoder' Serbinenko, 2012/02/21
- Re: Freeze on 27 February, Lennart Sorensen, 2012/02/21
- Lists and aliasing (Re: Freeze on 27 February), Vladimir 'φ-coder/phcoder' Serbinenko, 2012/02/21
- Re: Lists and aliasing (Re: Freeze on 27 February),
Lennart Sorensen <=
- Re: Lists and aliasing (Re: Freeze on 27 February), Lennart Sorensen, 2012/02/21
- Re: Lists and aliasing (Re: Freeze on 27 February), Vladimir 'φ-coder/phcoder' Serbinenko, 2012/02/21
- Re: Lists and aliasing (Re: Freeze on 27 February), Lennart Sorensen, 2012/02/22
- Re: Lists and aliasing (Re: Freeze on 27 February), Lennart Sorensen, 2012/02/22
- Re: Lists and aliasing (Re: Freeze on 27 February), Vladimir 'φ-coder/phcoder' Serbinenko, 2012/02/22
- Re: Lists and aliasing (Re: Freeze on 27 February), Lennart Sorensen, 2012/02/22
- Re: Lists and aliasing (Re: Freeze on 27 February), Lennart Sorensen, 2012/02/22
- Re: Lists and aliasing (Re: Freeze on 27 February), Lennart Sorensen, 2012/02/22
- Re: Lists and aliasing (Re: Freeze on 27 February), Vladimir 'φ-coder/phcoder' Serbinenko, 2012/02/22
- Re: Lists and aliasing (Re: Freeze on 27 February), Lennart Sorensen, 2012/02/22