public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/107885] H8/300: libsupc++/hash_bytes.cc fix shift-count-overflow warning
Date: Mon, 28 Nov 2022 16:57:45 +0000	[thread overview]
Message-ID: <bug-107885-4-xdD0Q1Rdnq@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107885-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107885

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:7b79fa930917da735f02b4f6911dfbb0a91f9714

commit r13-4369-g7b79fa930917da735f02b4f6911dfbb0a91f9714
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Nov 28 10:52:23 2022 +0000

    libstdc++: Fix _Hash_bytes for I16LP32 targets [PR107885]

    For H8/300 size_t is 32 bits wide, but (unsigned char)buf[2] << 16
    promotes to int which is only 16 bits wide. The shift is then undefined.
    This fixes it by converting to size_t before shifting.

    libstdc++-v3/ChangeLog:

            PR libstdc++/107885
            * libsupc++/hash_bytes.cc (_Hash_bytes): Convert to size_t
            instead of implicit integer promotion to 16 bits.

  parent reply	other threads:[~2022-11-28 16:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-27  0:12 [Bug libstdc++/107885] New: " uaa at mx5 dot nisiq.net
2022-11-27  0:28 ` [Bug libstdc++/107885] " redi at gcc dot gnu.org
2022-11-28 10:51 ` redi at gcc dot gnu.org
2022-11-28 16:57 ` cvs-commit at gcc dot gnu.org [this message]
2022-11-28 17:02 ` redi at gcc dot gnu.org
2023-10-28 22:31 ` law at gcc dot gnu.org

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

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

  git send-email \
    --in-reply-to=bug-107885-4-xdD0Q1Rdnq@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.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).