From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4E074383E822; Mon, 4 May 2020 11:51:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4E074383E822 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1588593062; bh=F1rR/okPHQaz1F5qVypQDRbX8XPql2UwGqI9ab1Nt60=; h=From:To:Subject:Date:In-Reply-To:References:From; b=b7rcy5ZZX74merbe4lUc0cUxYV1N4PthNghYgNek+oFCq9PNG3GIqV6+3qlrNE16w fNNQ+6qzuKBsuB9Y9AQcmh1LafG4MPvvCjBr416H94G/qACQ3zQvHTUreBm2SEO8mN OKAmRnj9OGuRzbKNlN+BWwb2qSLqRyAN6xnIfzrE= From: "bruno at clisp dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/78155] missing warning on invalid isalpha et al. Date: Mon, 04 May 2020 11:51:02 +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: 7.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: bruno at clisp dot org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: 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: cc attachments.created 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2020 11:51:02 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D78155 Bruno Haible changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bruno at clisp dot org --- Comment #6 from Bruno Haible --- Created attachment 48440 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D48440&action=3Dedit Test case Another test case is the attached program, alpha.c. When run on glibc syste= ms on x86, x86_64, and other CPUs (not powerpc), it sign-extends the 'char' argument; so the character '=C3=BF' (in ISO-8859-1 encoding) becomes EOF, a= nd the function returns 0. $ LC_ALL=3Dde_DE.ISO-8859-1 xterm $ ./a.out =C3=BF not alphabetic The corrected program (with a cast to 'unsigned char' in the isalpha() argument) behaves as expected: $ LC_ALL=3Dde_DE.ISO-8859-1 xterm $ ./a.out =C3=BF alphabetic=