From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MpHmZ-0003bC-3Y for mharc-grub-devel@gnu.org; Sun, 20 Sep 2009 04:28:31 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MpHmW-0003ax-3K for grub-devel@gnu.org; Sun, 20 Sep 2009 04:28:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MpHmR-0003aj-Gc for grub-devel@gnu.org; Sun, 20 Sep 2009 04:28:27 -0400 Received: from [199.232.76.173] (port=58817 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MpHmR-0003ag-7t for grub-devel@gnu.org; Sun, 20 Sep 2009 04:28:23 -0400 Received: from fg-out-1718.google.com ([72.14.220.155]:15179) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MpHmQ-0002q3-TW for grub-devel@gnu.org; Sun, 20 Sep 2009 04:28:23 -0400 Received: by fg-out-1718.google.com with SMTP id 22so753004fge.12 for ; Sun, 20 Sep 2009 01:28:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=fLym4pxkuWpm+fa+nbpVJFY0FtdXoZT5ZjD4Q74ZA5U=; b=D03TxxCZsS9c55SKkXeMeou8q4qbpYj12+5acLwV6T76yRTj2MaIDe2kqnyWzYCn0w CXd5n6cnUfziLJFenASk2A7WkTTp6j+nArdJSITPClo4G6XK5f3fzZ0CBNApTtjK1+zB wdkV1wKtqyPROpzgEPt42W7qLkxpaSj14agu4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=cbP3wGPNKe/zSe05GHifX8m881JR/a1L4znW1VfRRQrXTIaJjLi6voVtEhBx4196K3 z7hUI36a1Vk262e3ZfhtE0mogi7y9MWnib/rRO2Sd5uWZkyFwIE0i9Nv0QbclyA5qrYB pA4G4kL6YtgD/9zpqUvBfGp/OTZAHYo9SFpLc= Received: by 10.86.158.5 with SMTP id g5mr3455901fge.32.1253435301557; Sun, 20 Sep 2009 01:28:21 -0700 (PDT) Received: from ?192.168.1.16? (18-141.203-62.cust.bluewin.ch [62.203.141.18]) by mx.google.com with ESMTPS id 4sm4151965fge.4.2009.09.20.01.28.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 20 Sep 2009 01:28:20 -0700 (PDT) Message-ID: <4AB5E7A5.60404@gmail.com> Date: Sun, 20 Sep 2009 10:28:21 +0200 From: Vladimir 'phcoder' Serbinenko User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090701) MIME-Version: 1.0 To: The development of GRUB 2 References: <20090916194214.GA22363@thorin> <4AB4E6EB.4010307@gmail.com> <2e59e6970909192346h16fc71a2tc29d4441b951f7d3@mail.gmail.com> In-Reply-To: <2e59e6970909192346h16fc71a2tc29d4441b951f7d3@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: -Werror and --disable-werror X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 08:28:28 -0000 richardvoigt@gmail.com wrote: > On Sat, Sep 19, 2009 at 9:12 AM, Vladimir 'phcoder' Serbinenko > wrote: > >> Robert Millan wrote: >> >>> Hi, >>> >>> -Werror is not in effect. This will help ensuring that all new code is >>> checked to be warning-free before commit (incidentally, I found a newly >>> introduced bug thanks to this just minutes before enabling it). >>> >>> >>> >> If you mean this change: >> >> + /* Any value different than `p.offset' will satisfy the check during >> + first loop. */ >> + lastaddr = !p.offset; >> + >> >> Then there was no bug here. >> if (labeln && lastaddr == p.offset) >> return grub_error (GRUB_ERR_BAD_PART_TABLE, "loop detected"); >> >> labeln++; >> if ((labeln & (labeln - 1)) == 0) >> > > This is a check for being an integral power of 2 (or 0), i.e. having a > single bit set. Was that the intent? It's probably worth an > explanatory comment for the sake of those who aren't familiar with the > test. > > Read the code. There is a comment >> lastaddr = p.offset; >> >> labeln is 0 during first loop run and then lastaddr is set. I explicitly >> omitted initing variables to have smaller loop detector >> > > I suspect initializing lastaddr, which takes place outside the loop, > is less expensive than testing labeln on every iteration. > > We optimise for size, not for speed. >>> Since -Werror may be a problem in some situations, I've added a >>> --disable-werror switch, which does the obvious thing. >>> >>> >>> >> >> _______________________________________________ >> Grub-devel mailing list >> Grub-devel@gnu.org >> http://lists.gnu.org/mailman/listinfo/grub-devel >> >> > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > >