grub-devel
[Top][All Lists]
Advanced

[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: Wed, 22 Feb 2012 18:03:07 -0500
User-agent: Mutt/1.5.20 (2009-06-14)

On Wed, Feb 22, 2012 at 05:50:37PM -0500, Lennart Sorensen wrote:
> Now I get:
> 
> gcc-4.6 -DHAVE_CONFIG_H -I. -I../../../grub-core -I..  -Wall -W 
> -I../../../include -I../include  -DGRUB_MACHINE_EMU=1 
> -DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -m32 
> -DGRUB_FILE=\"normal/charset.c\" -I. -I../../../grub-core -I.. -I../../.. 
> -I../../../include -I../include   -I../../../grub-core/lib/posix_wrap   -Os 
> -Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition 
> -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes 
> -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered 
> -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations 
> -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels 
> -Wfloat-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security 
> -Wformat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration 
> -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch 
> -Wunsafe-loop-optimizations -Wlogical-op -Wmain -Wmissing-braces 
> -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -W
> mudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat 
> -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type 
> -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch 
> -Wsync-nand -Wtrigraphs  -Wtype-limits -Wundef -Wuninitialized 
> -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label 
> -Wunused-parameter -Wunused-value  -Wunused-variable -Wvariadic-macros 
> -Wvolatile-register-var -Wwrite-strings -Wmissing-parameter-type 
> -Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls 
> -Wmissing-prototypes -Wmissing-declarations -fno-dwarf2-cfi-asm 
> -fno-asynchronous-unwind-tables -m32 -fno-stack-protector -Werror 
> -Wno-trampolines -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1         
> -ffreestanding -fno-builtin -Wno-redundant-decls   -c -o 
> normal/normal_module-charset.o `test -f 'normal/charset.c' || echo 
> '../../../grub-core/'`normal/charset.c
> ../../../grub-core/normal/charset.c: In function 'bidi_line_wrap':
> ../../../grub-core/normal/charset.c:737:55: error: comparison between signed 
> and unsigned integer expressions [-Werror=sign-compare]
> cc1: all warnings being treated as errors

For some reason the compiler thinks GRUB_INT_MIN which is defined as
-0x80000000 is unsigned.

If I do:

            int right_join = 0;
            signed i;
            for (i = k - 1; i > (signed) line_start - 1 && i > (signed) 
GRUB_INT_MIN;
                 i--)
              {

then gcc 4.6 stops complaining, but gcc 4.4 complains about:

gcc-4.4 -DHAVE_CONFIG_H -I. -I../../../grub-core -I..  -Wall -W 
-I../../../include -I../include  -DGRUB_MACHINE_EMU=1 
-DGRUB_MACHINE=POWERPC_EMU -DGRUB_TARGET_CPU_POWERPC=1 -m32 
-DGRUB_FILE=\"normal/charset.c\" -I. -I../../../grub-core -I.. -I../../.. 
-I../../../include -I../include   -I../../../grub-core/lib/posix_wrap   -Os 
-Wall -W -Wshadow -Wold-style-declaration -Wold-style-definition 
-Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattributes 
-Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered -Wcomment 
-Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations 
-Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal 
-Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y2k 
-Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int 
-Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-optimizations 
-Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initializers 
-Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar -Wnonnull 
-Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith 
-Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare 
-Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs  -Wtype-limits -Wundef 
-Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label 
-Wunused-parameter -Wunused-value  -Wunused-variable -Wvariadic-macros 
-Wvolatile-register-var -Wwrite-strings -Wmissing-parameter-type 
-Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls 
-Wmissing-prototypes -Wmissing-declarations -fno-dwarf2-cfi-asm 
-fno-asynchronous-unwind-tables -m32 -fno-stack-protector -Werror 
-DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1         -ffreestanding 
-fno-builtin -Wno-redundant-decls   -c -o normal/normal_module-charset.o `test 
-f 'normal/charset.c' || echo '../../../grub-core/'`normal/charset.c
cc1: warnings being treated as errors
../../../grub-core/normal/charset.c: In function 
'grub_bidi_line_logical_to_visual':
../../../grub-core/normal/charset.c:737: error: cannot optimize possibly 
infinite loops

If I do what is already done for GRUB_LONG_MIN and use:
#define GRUB_INT_MIN (-0x7fffffff - 1)

...then gcc 4.6 is happy.  gcc 4.4 goes on complaining about the inability
to optimize possibly infinite loops.

-- 
Len Sorensen



reply via email to

[Prev in Thread] Current Thread [Next in Thread]