From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F1F5C3858D3C; Thu, 22 Jun 2023 17:37:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F1F5C3858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687455455; bh=NMTUBnn2IAzgsFd0Nq/tZ7f9u5lomRI0GfZHoJqRa8U=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jNUezo2iJrDGSpv1MV1YkOTYMoK6/ky+Xuy7KZTs7SFMvxsgoX4Ekz6XL6ns7+mhd eaLP1aIvoWtPJMhUKlvfgozKvITQ3q22/q4CqPsD3D1gJsFq1ErTiU/V3rlhTYeY43 21/LpR0MPpdMaip+3dS/gtcEtUm7cZzwS12KvyWI= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/110368] Incorrect "is used uninitialized" warning message Date: Thu, 22 Jun 2023 17:37:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 13.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110368 --- Comment #5 from Andrew Pinski --- (In reply to Andrew Pinski from comment #4) > The code can fixed using memcpy > Replace: > c +=3D *data_16++ >=20 > With: > unsigned tmp; > memcpy(&tmp, data_16, sizeof(tmp)); > data_16++; > c +=3D tmp; Small typo, the type of tmp should have been `unsigned short`.=