[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Frozen

From: Vladimir 'φ-coder/phcoder' Serbinenko
Subject: Re: Frozen
Date: Sun, 04 Mar 2012 13:17:29 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20120216 Icedove/8.0

On 01.03.2012 20:15, Lennart Sorensen wrote:
On Thu, Mar 01, 2012 at 01:37:10PM -0500, Lennart Sorensen wrote:
gcc-4.4 -DHAVE_CONFIG_H -I. -I../../../grub-core -I..  -Wall -W -I../../../include 
-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 
-ffreestanding -fno-builtin -Wno-redundant-decls   -c -o 
normal/normal_module-charset.o `test -f 'normal/charset.c' || echo 
cc1: warnings being treated as errors
../../../grub-core/normal/charset.c: In function 
../../../grub-core/normal/charset.c:636: error: cannot optimize possibly 
infinite loops
Would using this instead work:

for (i = k - 1; i>= 0&&  (unsigned) i>  line_start - 1;

After all if i already had to be>=0 then casting it to unsigned has no
harm, whereas casting line_start to signed could potentially generate
a very negative number if line_start was very big.
You forget the case line_start = 0. Please try:
-        for (i = k - 1; i > (signed) line_start - 1 && i >= 0;
+        for (i = k - 1; i >= 0 && (unsigned) i >= line_start;
The compiler approves.

Vladimir 'φ-coder/phcoder' Serbinenko

reply via email to

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