bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: "Tim Rühsen" <tim.ruehsen@gmx.de>
To: bug-gnulib@gnu.org
Subject: clang-10 warning in hash.c
Date: Mon, 27 Jan 2020 11:58:14 +0100	[thread overview]
Message-ID: <ac0b82a1-816f-2fef-7009-2d4475531296@gmx.de> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 969 bytes --]

Not sure if the compiler is correct here, but maybe worth a look:

hash.c:549:11: error: implicit conversion from 'unsigned long' to
'float' changes value from 18446744073709551615 to 18446744073709551616
[-Werror,-Wimplicit-int-float-conversion]
      if (SIZE_MAX <= new_candidate)
          ^~~~~~~~ ~~
/usr/include/stdint.h:227:22: note: expanded from macro 'SIZE_MAX'
#  define SIZE_MAX              (18446744073709551615UL)
                                 ^~~~~~~~~~~~~~~~~~~~~~
hash.c:1079:15: error: implicit conversion from 'unsigned long' to
'float' changes value from 18446744073709551615 to 18446744073709551616
[-Werror,-Wimplicit-int-float-conversion]
          if (SIZE_MAX <= candidate)
              ^~~~~~~~ ~~
/usr/include/stdint.h:227:22: note: expanded from macro 'SIZE_MAX'
#  define SIZE_MAX              (18446744073709551615UL)
                                 ^~~~~~~~~~~~~~~~~~~~~~
2 errors generated.


Regards, Tim


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

             reply	other threads:[~2020-01-27 10:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-27 10:58 Tim Rühsen [this message]
2020-01-27 13:09 ` clang-10 warning in hash.c Bruno Haible
2020-01-27 20:16   ` Paul Eggert
2020-01-27 21:03     ` Bruno Haible
2020-01-28  2:08       ` Bruno Haible
2020-01-30 15:35   ` Tim Rühsen
2020-01-30 17:50     ` bugs.llvm.org Bruno Haible

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ac0b82a1-816f-2fef-7009-2d4475531296@gmx.de \
    --to=tim.ruehsen@gmx.de \
    --cc=bug-gnulib@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).