From patchwork Wed Feb 6 08:26:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 1037361 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-99801-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="e5IFKqdi"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43vZLK1f9pz9sDX for ; Wed, 6 Feb 2019 19:27:05 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:mime-version:content-type :message-id; q=dns; s=default; b=BQvgmePVlFAOP2nTn/P9rRlWnCXWjxz Lwz+717votfCQw0trEs7qAHx6fbOBjkc0zbqb1cv4RmYtkBRIHF8T1TwstE5+5Vm 6n8C8RGas5qBd0sbJyK2XfMTBhc0/L+msfLwggpgieXxX9fK9Mqrw4OZOLHVOfm3 7CgVNQkLB5SA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:mime-version:content-type :message-id; s=default; bh=IWoGjtg8xClrh2j2VuQy1Zq7QiE=; b=e5IFK qdiB2CEJzJeIlegTwUuM1ffrZn2LrkIS9IeMcCYmyce+7TLHsYKRdnPY3SWYfEOT hylBnq/rN6fVx1fYkpSM7RwRrUzAN6brjYLKGkEW1zEnhG8v4bILld0B3mhiAF60 u89nc4JLNTfHRGCtGd0vaPFqr2FNUpfFR6H3TE= Received: (qmail 71165 invoked by alias); 6 Feb 2019 08:26:53 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 71069 invoked by uid 89); 6 Feb 2019 08:26:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=La, la, bye X-HELO: mx0a-001b2d01.pphosted.com To: GNU C Library From: Stefan Liebler Subject: [PATCH] Fix wide char format specifier in libio/tst-bz24153.c. Date: Wed, 6 Feb 2019 09:26:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 x-cbid: 19020608-0020-0000-0000-0000031362FF X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19020608-0021-0000-0000-000021646481 Message-Id: <254ace6c-4f93-7c75-cef5-f466e8360e06@linux.ibm.com> Hi, on big endian systems the test fails with: tst-bz24153.c:88: numeric comparison failure left: 1660944385 (0x63000001); from: ch right: 99 (0x63); from: L'c' tst-bz24153.c:90: numeric comparison failure left: 1677721601 (0x64000001); from: ch right: 100 (0x64); from: L'd' error: 2 test failures One 'char' ("%c") is stored to the pointer 'wchar_t *': ch = 0x00000001 | 0x63000000 This patch is using "%lc" as format specifier to read a wchar_t. Okay to commit? Bye, Stefan ChangeLog: * libio/tst-bz24153.c (wide): Use wide char format specifier. commit 6e7024f01e6aa344dc560027bcc2bd6e0ee41e5b Author: Stefan Liebler Date: Tue Feb 5 16:55:00 2019 +0100 Fix wide char format specifier in libio/tst-bz24153.c. On big endian systems the test fails with: tst-bz24153.c:88: numeric comparison failure left: 1660944385 (0x63000001); from: ch right: 99 (0x63); from: L'c' tst-bz24153.c:90: numeric comparison failure left: 1677721601 (0x64000001); from: ch right: 100 (0x64); from: L'd' error: 2 test failures One 'char' ("%c") is stored to the 'wchar_t *': ch = 0x00000001 | 0x63000000 This patch is using "%lc" as format specifier to read a wchar_t. ChangeLog: * libio/tst-bz24153.c (wide): Use wide char format specifier. diff --git a/libio/tst-bz24153.c b/libio/tst-bz24153.c index 85ad1415df..be0e6bfcf1 100644 --- a/libio/tst-bz24153.c +++ b/libio/tst-bz24153.c @@ -84,9 +84,9 @@ wide (const char *path) TEST_COMPARE (getwchar (), L'a'); TEST_COMPARE (getwchar_unlocked (), L'b'); wchar_t ch = 1; - TEST_COMPARE (wscanf (L"%c", &ch), 1); + TEST_COMPARE (wscanf (L"%lc", &ch), 1); TEST_COMPARE (ch, L'c'); - TEST_COMPARE (call_vwscanf (L"%c", &ch), 1); + TEST_COMPARE (call_vwscanf (L"%lc", &ch), 1); TEST_COMPARE (ch, L'd'); fclose (stdin);