From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1S0FOx-0002WR-7X for mharc-grub-devel@gnu.org; Wed, 22 Feb 2012 11:50:47 -0500 Received: from eggs.gnu.org ([140.186.70.92]:43910) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0FOq-0002W5-8Y for grub-devel@gnu.org; Wed, 22 Feb 2012 11:50:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0FOm-0002ur-BV for grub-devel@gnu.org; Wed, 22 Feb 2012 11:50:40 -0500 Received: from mail-ee0-f41.google.com ([74.125.83.41]:58641) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0FOl-0002ue-RW for grub-devel@gnu.org; Wed, 22 Feb 2012 11:50:36 -0500 Received: by eekc13 with SMTP id c13so75912eek.0 for ; Wed, 22 Feb 2012 08:50:34 -0800 (PST) Received-SPF: pass (google.com: domain of phcoder@gmail.com designates 10.14.95.201 as permitted sender) client-ip=10.14.95.201; Authentication-Results: mr.google.com; spf=pass (google.com: domain of phcoder@gmail.com designates 10.14.95.201 as permitted sender) smtp.mail=phcoder@gmail.com; dkim=pass header.i=phcoder@gmail.com Received: from mr.google.com ([10.14.95.201]) by 10.14.95.201 with SMTP id p49mr15763552eef.53.1329929434890 (num_hops = 1); Wed, 22 Feb 2012 08:50:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=tEGV3TsJi+ntGXFuQZsB8KUh3+NRYKppWyNqEVmIbI0=; b=EVTgYRekReXDDR5//9A91LAQQ2POKR5wgqNORITVeM3v0aGbrpd0/xpBjK8LylqwOk KTfD473SMfDsnBI1srkn1eSKaKQJ/uqBMqCJYnWClaz3nNTdk0kMCadBF7vSlRJVCAbU LuDzfwZipUMIaj1pJoYoppQrqln3kfwmvzB94= Received: by 10.14.95.201 with SMTP id p49mr12645961eef.53.1329929434817; Wed, 22 Feb 2012 08:50:34 -0800 (PST) Received: from debian.x201.phnet (77-233.197-178.cust.bluewin.ch. [178.197.233.77]) by mx.google.com with ESMTPS id n17sm104440338eei.3.2012.02.22.08.50.32 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 22 Feb 2012 08:50:33 -0800 (PST) Message-ID: <4F451CD7.9080106@gmail.com> Date: Wed, 22 Feb 2012 17:50:31 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20120216 Icedove/8.0 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: Lists and aliasing (Re: Freeze on 27 February) References: <4F43C25C.2040106@gmail.com> <20120221161943.GI27742@caffeine.csclub.uwaterloo.ca> <4F43CFD0.3010703@gmail.com> <20120221184627.GK27742@caffeine.csclub.uwaterloo.ca> <20120221195838.GA24235@caffeine.csclub.uwaterloo.ca> <4F43FE94.3040401@gmail.com> <20120222153418.GE24235@caffeine.csclub.uwaterloo.ca> <20120222155041.GF24235@caffeine.csclub.uwaterloo.ca> <4F451057.5080404@gmail.com> <20120222161854.GG24235@caffeine.csclub.uwaterloo.ca> <20120222162522.GH24235@caffeine.csclub.uwaterloo.ca> In-Reply-To: <20120222162522.GH24235@caffeine.csclub.uwaterloo.ca> Content-Type: multipart/mixed; boundary="------------050609060006040409050307" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.83.41 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Feb 2012 16:50:44 -0000 This is a multi-part message in MIME format. --------------050609060006040409050307 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable On 22.02.2012 17:25, Lennart Sorensen wrote: > On Wed, Feb 22, 2012 at 11:18:54AM -0500, Lennart Sorensen wrote: >> Well it is in WARN_FLAGS and TARGET_CFLAGS in configure. >> >> And during build: >> gcc-4.4 -DHAVE_CONFIG_H -I. -I../.. -Wall -W -I./include -DGRUB_UTIL=3D= 1 -DGRUB_LIBDIR=3D\"/usr/lib/grub\" -DLOCALEDIR=3D\"/usr/share/locale\" = -DGRUB_MACHINE_EMU=3D1 -DGRUB_MACHINE=3DPOWERPC_EMU -DGRUB_TARGET_CPU_POW= ERPC=3D1 -DGRUB_FILE=3D\"util/grub-mkimage.c\" -I. -I../.. -I. -I../.. -I= =2E./../include -I./include -I./grub-core/gnulib -I../../grub-core/gnulib= -DGRUB_PKGLIBROOTDIR=3D\"/usr/lib/grub\" -g -Wall -O2 -Wall -W -Wshado= w -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-ze= ro -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-contains-nul -Wform= at-extra-args -Wformat-security -Wformat-y2k -Wignored-qualifiers -Wimpli= cit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-p= ointer-cast -Winvalid-pch -Wunsafe-loop-optimizations -Wlogical-op -Wmain= -Wmissing-braces -W >> missing-field-initializers -Wmissing-format-attribute -Wmissing-noretu= rn -Wmudflap -Wmultichar -Wnonnull -Woverflow -Wpacked-bitfield-compat -W= parentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequenc= e-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -W= trigraphs -Wtype-limits -Wundef -Wuninitialized -Wunknown-pragmas -Wunus= ed -Wunused-function -Wunused-label -Wunused-parameter -Wunused-result -W= unused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var= -Wwrite-strings -Wmissing-declarations -Wmissing-parameter-type -Wmissi= ng-prototypes -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Wno-un= def -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-de= cls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition -c = -o util/grub_mkimage-grub-mkimage.o `test -f 'util/grub-mkimage.c' || ech= o '../../'`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=3D"$HOST_CFLAGS $WARN_FLAGS" > TARGET_CFLAGS=3D"$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmiss= ing-prototypes" > > but WARN_FLAGS=3D"-Wall -W -Wshadow -Wold-style-declaration -Wold-style= -definition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wat= tributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobb= ered -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations= -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloa= t-equal -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wfor= mat-y2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -= Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-lo= op-optimizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-ini= tializers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmulti= char -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointe= r-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Ws= ign-compare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-li= mits -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function= -Wunused-label -Wunused-parameter -Wunused-result -Wunused-value -Wunus= ed-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wm= issing-declarations -Wmissing-parameter-type -Wmissing-prototypes -Wnest= ed-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. > --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------050609060006040409050307 Content-Type: text/x-diff; name="warn.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="warn.diff" =3D=3D=3D modified file 'conf/Makefile.common' --- conf/Makefile.common 2012-02-22 15:27:39 +0000 +++ conf/Makefile.common 2012-02-22 16:29:31 +0000 @@ -104,7 +104,7 @@ CFLAGS_GCRY =3D -Wno-error -Wno-missing-field-initializers CPPFLAGS_GCRY =3D -I$(top_srcdir)/grub-core/lib/libgcrypt_wrap =20 -CFLAGS_GNULIB =3D -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-p= arameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-= old-style-definition +CFLAGS_GNULIB =3D -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-p= arameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-= old-style-definition -Wno-unsafe-loop-optimisations CPPFLAGS_GNULIB =3D -I$(top_builddir)/grub-core/gnulib -I$(top_srcdir)/g= rub-core/gnulib =20 CFLAGS_POSIX =3D -fno-builtin =3D=3D=3D modified file 'configure.ac' --- configure.ac 2012-02-22 03:56:45 +0000 +++ configure.ac 2012-02-22 16:32:32 +0000 @@ -377,7 +377,7 @@ LIBS=3D"" =20 # debug flags. -WARN_FLAGS=3D"-Wall -W -Wshadow -Wold-style-declaration -Wold-style-defi= nition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattribu= tes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered = -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdi= sabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equ= al -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y= 2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimpl= icit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-op= timizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initiali= zers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar = -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-ari= th -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-c= ompare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits = -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wun= used-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadi= c-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -= Wmissing-parameter-type -Wmissing-prototypes -Wnested-externs -Wstrict-p= rototypes -Wpointer-sign" +WARN_FLAGS=3D"-Wall -W -Wshadow -Wold-style-declaration -Wold-style-defi= nition -Wpointer-arith -Wundef -Wextra -Waddress -Warray-bounds -Wattribu= tes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wclobbered = -Wcomment -Wcoverage-mismatch -Wdeprecated -Wdeprecated-declarations -Wdi= sabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equ= al -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-y= 2k -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimpl= icit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wunsafe-loop-op= timizations -Wlogical-op -Wmain -Wmissing-braces -Wmissing-field-initiali= zers -Wmissing-format-attribute -Wmissing-noreturn -Wmudflap -Wmultichar = -Wnonnull -Woverflow -Wpacked-bitfield-compat -Wparentheses -Wpointer-ari= th -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-c= ompare -Wstrict-aliasing -Wswitch -Wsync-nand -Wtrigraphs -Wtype-limits = -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wun= used-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadi= c-macros -Wvolatile-register-var -Wwrite-strings -Wmissing-declarations -= Wmissing-parameter-type -Wnested-externs -Wstrict-prototypes -Wpointer-si= gn" HOST_CFLAGS=3D"$HOST_CFLAGS $WARN_FLAGS" TARGET_CFLAGS=3D"$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissi= ng-prototypes" TARGET_CCASFLAGS=3D"$TARGET_CCASFLAGS -g" =3D=3D=3D modified file 'grub-core/commands/legacycfg.c' --- grub-core/commands/legacycfg.c 2012-02-12 14:25:25 +0000 +++ grub-core/commands/legacycfg.c 2012-02-22 16:06:00 +0000 @@ -547,11 +547,11 @@ check_password_md5_real (const char *entered, struct legacy_md5_password *pw) { - int enteredlen =3D grub_strlen (entered); + grub_size_t enteredlen =3D 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; =20 GRUB_MD_MD5->init (ctx); GRUB_MD_MD5->write (ctx, entered, enteredlen); =3D=3D=3D modified file 'grub-core/commands/testload.c' --- grub-core/commands/testload.c 2012-02-22 04:04:54 +0000 +++ grub-core/commands/testload.c 2012-02-22 16:25:36 +0000 @@ -77,19 +77,24 @@ grub_printf ("Reading %s sequentially again", argv[0]); grub_file_seek (file, 0); =20 - for (pos =3D 0; pos < size; pos +=3D GRUB_DISK_SECTOR_SIZE) + for (pos =3D 0; pos < size;) { char sector[GRUB_DISK_SECTOR_SIZE]; - - if (grub_file_read (file, sector, GRUB_DISK_SECTOR_SIZE) - !=3D GRUB_DISK_SECTOR_SIZE) + grub_size_t curlen =3D GRUB_DISK_SECTOR_SIZE; + + if (curlen > size - pos) + curlen =3D size - pos; + + if (grub_file_read (file, sector, curlen) + !=3D (grub_ssize_t) curlen) goto fail; =20 - if (grub_memcmp (sector, buf + pos, GRUB_DISK_SECTOR_SIZE) !=3D 0)= + if (grub_memcmp (sector, buf + pos, curlen) !=3D 0) { grub_printf ("\nDiffers in %lld\n", (unsigned long long) pos); goto fail; } + pos +=3D curlen; } grub_printf (" Done.\n"); =20 =3D=3D=3D modified file 'grub-core/disk/ldm.c' --- grub-core/disk/ldm.c 2012-02-10 11:36:02 +0000 +++ grub-core/disk/ldm.c 2012-02-22 15:59:21 +0000 @@ -831,7 +831,7 @@ { struct grub_diskfilter_pv *pv =3D NULL; struct grub_diskfilter_vg *vg =3D NULL; - struct grub_diskfilter_lv *res, *lv; + struct grub_diskfilter_lv *res =3D 0, *lv, *res_lv; =20 pv =3D grub_diskfilter_get_pv_from_disk (disk, &vg); =20 @@ -844,19 +844,21 @@ && lv->segments->nodes->pv =3D=3D pv && lv->segments->nodes->start + pv->start_sector =3D=3D start) { - res =3D lv; + res_lv =3D lv; break; } + if (!res_lv) + return NULL; for (lv =3D vg->lvs; lv; lv =3D lv->next) if (lv->segment_count =3D=3D 1 && lv->segments->node_count =3D=3D 1 && lv->segments->type =3D=3D GRUB_DISKFILTER_MIRROR - && lv->segments->nodes->lv =3D=3D lv) + && lv->segments->nodes->lv =3D=3D res_lv) { res =3D lv; break; } - if (res->fullname) - return grub_strdup (lv->fullname); + if (res && res->fullname) + return grub_strdup (res->fullname); return NULL; } =20 =3D=3D=3D modified file 'grub-core/fs/zfs/zfs_sha256.c' --- grub-core/fs/zfs/zfs_sha256.c 2010-12-01 21:55:26 +0000 +++ grub-core/fs/zfs/zfs_sha256.c 2012-02-22 16:17:39 +0000 @@ -129,7 +129,7 @@ for (i =3D 0; i < 8; i++) pad[padsize++] =3D (size << 3) >> (56 - 8 * i); =20 - for (i =3D 0; i < padsize; i +=3D 64) + for (i =3D 0; i < padsize && i <=3D 64; i +=3D 64) SHA256Transform(H, pad + i); =20 zcp->zc_word[0] =3D grub_cpu_to_zfs64 ((grub_uint64_t)H[0] << 32 | H[1= ],=20 =3D=3D=3D modified file 'grub-core/io/gzio.c' --- grub-core/io/gzio.c 2012-02-12 14:25:25 +0000 +++ grub-core/io/gzio.c 2012-02-22 16:45:45 +0000 @@ -363,6 +363,8 @@ 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff }; =20 +#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations" + #define NEEDBITS(n) do {while(k<(n)){b|=3D((ulg)get_byte(gzio))<>=3D(n);k-=3D(n);} while (0) =20 =3D=3D=3D modified file 'grub-core/lib/LzmaEnc.c' --- grub-core/lib/LzmaEnc.c 2012-02-10 15:48:48 +0000 +++ grub-core/lib/LzmaEnc.c 2012-02-22 16:16:26 +0000 @@ -1211,7 +1211,7 @@ { UInt32 i; reps[0] =3D prevOpt->backs[pos]; - for (i =3D 1; i <=3D pos; i++) + for (i =3D 1; i < pos + 1; i++) reps[i] =3D prevOpt->backs[i - 1]; for (; i < LZMA_NUM_REPS; i++) reps[i] =3D prevOpt->backs[i]; =3D=3D=3D modified file 'grub-core/normal/cmdline.c' --- grub-core/normal/cmdline.c 2012-02-12 18:24:23 +0000 +++ grub-core/normal/cmdline.c 2012-02-22 16:21:47 +0000 @@ -49,13 +49,13 @@ /* Remove the lines that don't fit in the new buffer. */ if (newsize < hist_used) { - int i; - int delsize =3D hist_used - newsize; + grub_size_t i; + grub_size_t delsize =3D hist_used - newsize; hist_used =3D newsize; =20 - for (i =3D 1; i <=3D delsize; i++) + for (i =3D 1; i < delsize + 1; i++) { - int pos =3D hist_end - i; + grub_ssize_t pos =3D hist_end - i; if (pos < 0) pos +=3D hist_size; grub_free (old_hist_lines[pos]); =3D=3D=3D modified file 'grub-core/script/parser.y' --- grub-core/script/parser.y 2012-02-10 15:48:48 +0000 +++ grub-core/script/parser.y 2012-02-22 16:47:55 +0000 @@ -31,6 +31,7 @@ #include "grub_script.tab.h" =20 #pragma GCC diagnostic ignored "-Wunreachable-code" +#pragma GCC diagnostic ignored "-Wmissing-declarations" %} =20 %union { =3D=3D=3D modified file 'grub-core/script/yylex.l' --- grub-core/script/yylex.l 2012-02-03 10:56:49 +0000 +++ grub-core/script/yylex.l 2012-02-22 16:49:25 +0000 @@ -27,6 +27,8 @@ =20 #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" =20 #define yyfree grub_lexer_yyfree #define yyalloc grub_lexer_yyalloc =3D=3D=3D modified file 'util/grub-mkfont.c' --- util/grub-mkfont.c 2012-02-10 12:31:43 +0000 +++ util/grub-mkfont.c 2012-02-22 16:15:31 +0000 @@ -717,7 +717,7 @@ =20 bitmap =3D glyph->bitmap; mask =3D 0x80; - for (y =3D ymax - 1; y >=3D ymin; y--) + for (y =3D ymax - 1; y > ymin - 1; y--) { int line_pos; =20 --------------050609060006040409050307--