lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 13 Oct 2011 10:43:24 +0200
From:	Geert Uytterhoeven <geert@...ux-m68k.org>
To:	Philipp Reisner <philipp.reisner@...bit.com>
Cc:	drbd-dev@...ts.linbit.com, David Howells <dhowells@...hat.com>,
	Jens Axboe <axboe@...nel.dk>, linux-kernel@...r.kernel.org
Subject: Re: [Drbd-dev] [PATCH 13/13] DRBD: Fix comparison always false
 warning due to long/long long compare

On Thu, Oct 13, 2011 at 10:25, Philipp Reisner
<philipp.reisner@...bit.com> wrote:
> Am Mittwoch, 12. Oktober 2011, 15:35:28 schrieb Geert Uytterhoeven:
>> On Wed, Oct 12, 2011 at 14:27, Philipp Reisner
>> <philipp.reisner@...bit.com> wrote:
>> > From: David Howells <dhowells@...hat.com>
>> >
>> > Fix warnings of the following nature in the drbd header:
>> >
>> > In file included from drivers/block/drbd/drbd_bitmap.c:32:
>> > drivers/block/drbd/drbd_int.h: In function 'drbd_get_syncer_progress':
>> > drivers/block/drbd/drbd_int.h:2234: warning: comparison is always false
>> > due to limited range of data
>> >
>> > where mdev->rs_total (an unsigned long) is being compared to 1ULL << 32,
>> > which is always false on a 32-bit machine.
>>
>> But on 32-bit, unsigned long is never larger than UINT_MAX neither, so
>> it doesn't
>> really change anything??
>
> As the commit message says, David's intention was to silence a compiler
> warning, not to change anything.

Sure, but
  1) Is the comparison a bug on 32-bit?
  2) I don't see a reason why (a different version of) gcc won't give
a warning for the
      new comparison always being false.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ