Message ID | 84fb3b5f7c4c0ea690ac3056fb2a8d97610dd3b4.1666877952.git.szabolcs.nagy@arm.com (mailing list archive) |
---|---|
State | Committed |
Commit | f9deea6f81cd5266ffb3d27e2584d609fef9b8d2 |
Headers |
Return-Path: <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 68565394C831 for <patchwork@sourceware.org>; Thu, 27 Oct 2022 15:35:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 68565394C831 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666884938; bh=i0uDrDx470aosdYBHSRXN/vXOuolOcZzLoBYmwKdWhc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=hjmOgLkKdZUaqZJzTtzjSaHu5xDI5UwOCwcBMH6dP4hJorO0ozHLK7CW8h5L8+ooa 2ON/5uPmtrCJKd0GRYFkebVx3yUd1MD5xyHtsSVNa0IR6y2Aj47BEGY3gVyPzOm6eL SM6rztZlchfcz378iSkMXDRgNDNcc5oLeGGjgEbo= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130050.outbound.protection.outlook.com [40.107.13.50]) by sourceware.org (Postfix) with ESMTPS id 5DBB13887F43 for <libc-alpha@sourceware.org>; Thu, 27 Oct 2022 15:33:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5DBB13887F43 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=ab3qfDNlbed428FRvFA1LcQPsxtXPKUuH6fUU9vvlrUUjPq/o1gEcZPxdkv+EsnUVx6NflGHCktKHamU+unFQEWAsse912XVSYZ2VuGrJVDRhrqctE3CydX+EZEgRCII3S+t3gRI1AE8fgP+Eqc32+9EZklmjZVQF4t+B5FLYXOHK3fhaa/JXJZ95bolakAqtoQVBdS6CBolqKyFXTi+5j6/Muex6IoegP13Rp8PFnE+N+kjak9g/fr8Lm98GDY1BfMkmHuNKYC5IdQ9+JSQyzgTkhMPsSDVg7owZGils7GhkW+lX/+9mSGeAZUGs/XfykY45C/wps53xeP/mXcP+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=i0uDrDx470aosdYBHSRXN/vXOuolOcZzLoBYmwKdWhc=; b=id4B1RJIS5K6/D0IxEKIspDLkXE/nrpkV7vakaA/NRNBqvaVcJ4JjUgkLLY9HYRAEVQGWs7gHRUV1BVDCFnb+zM5xA7OCmbVU1/NlpJiuiMyAipWpDTN6/UStFrZrUSCadKs3A0Lp/rn5sQezSUsyD8l3QaVc2kjg3IcSQTYHtLqsrHdqMwSXd/7rDh/kiH6U7sEvfDxAU8lShm7uvATPWy2RPhRrlG2ncElWLVZr8QJLC0lsa+b6KMT7svWRe6RUZVcTkIl+COal7vDr9u0gtJ1LC68YhDnXyIhI+MJQS/B4ttqqVpNyebJPZ98eudaqKJZbOKDYp/y4BFSu0pjCw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1, 1, smtp.mailfrom=arm.com] dmarc=[1, 1, header.from=arm.com]) Received: from DBBPR09CA0031.eurprd09.prod.outlook.com (2603:10a6:10:d4::19) by PAWPR08MB8912.eurprd08.prod.outlook.com (2603:10a6:102:33d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28; Thu, 27 Oct 2022 15:33:28 +0000 Received: from DBAEUR03FT050.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:d4:cafe::a4) by DBBPR09CA0031.outlook.office365.com (2603:10a6:10:d4::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28 via Frontend Transport; Thu, 27 Oct 2022 15:33:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT050.mail.protection.outlook.com (100.127.142.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.20 via Frontend Transport; Thu, 27 Oct 2022 15:33:28 +0000 Received: ("Tessian outbound 0800d254cb3b:v130"); Thu, 27 Oct 2022 15:33:28 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 874f8899dae86f22 X-CR-MTA-TID: 64aa7808 Received: from a6735d4c4acd.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id C659E991-F5FE-4FBA-A7CD-4489D29BA703.1; Thu, 27 Oct 2022 15:33:21 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a6735d4c4acd.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 27 Oct 2022 15:33:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l36Z4cHt4FjA0h0AMgHhh8AQ94h41UoY5O1Y+P17++QEPegfiyqbTXfkwahrxF7VMWIvHv+BxoM0EdCRheepZeBDvyo/+i3rWAt56O1LeTKSoAkj21kWtNfFYhAiZheA5ttPrd7ENGU1j3XQW5vkFZrgJHlNvc/5fcL4GStCxt7XNCSKePb1QazyqJUKKfvk4b2QKbLX5OhZBszxiRhp6K6WkeHvCKt1VN7Da32M/cQpFhIrGO4P9c317+6dAhQMN1DrHGk4DlYQWvaGAXFW20qHfVyn7D4tfsGGmj3cW7ud5DtFAnSC0K+/T6XFPDe6Qg+r6IPxU8DNvZnUDOuacw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=i0uDrDx470aosdYBHSRXN/vXOuolOcZzLoBYmwKdWhc=; b=dYkhOq/ibrMjvYSY/Nt+lU2w5ZzN831q6K72i3mmt4NNi7QQThb9+vNFDkdYJzzsgsTwAXw1RSn5XdMqZ7/fmGjgFVHvx7gc970oaPjtKKyX3qmqBpSX4C+lr3Bu46kb47uaMOSRq55PqBR2UcoSXOb8qdfmnpOCeBCaoBuZxno028ms2Ij/KGEvuUTWc7WqLGV4JmQrr/pNPzR4nOBBOwqiGL0VEMH0Mbhoe37UyimkAscMpT3KdKj3tT9tRTLYFB1zKEsVIc4sx6tafMS/UpQKjfKhfPR53O0p69pbc+d9rEKo1ZSwWMqYgRa1gVFLO7tonw9S1A55131Lyh29CA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none Received: from DB6PR0402CA0002.eurprd04.prod.outlook.com (2603:10a6:4:91::12) by AS8PR08MB9672.eurprd08.prod.outlook.com (2603:10a6:20b:614::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28; Thu, 27 Oct 2022 15:33:19 +0000 Received: from DBAEUR03FT040.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:91:cafe::c0) by DB6PR0402CA0002.outlook.office365.com (2603:10a6:4:91::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15 via Frontend Transport; Thu, 27 Oct 2022 15:33:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by DBAEUR03FT040.mail.protection.outlook.com (100.127.142.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5769.14 via Frontend Transport; Thu, 27 Oct 2022 15:33:19 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Thu, 27 Oct 2022 15:33:19 +0000 Received: from armchair.cambridge.arm.com (10.2.80.71) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Thu, 27 Oct 2022 15:33:18 +0000 To: <libc-alpha@sourceware.org> Subject: [PATCH 13/20] Use uintptr_t in string/tester for pointer alignment Date: Thu, 27 Oct 2022 16:33:18 +0100 Message-ID: <84fb3b5f7c4c0ea690ac3056fb2a8d97610dd3b4.1666877952.git.szabolcs.nagy@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <cover.1666877952.git.szabolcs.nagy@arm.com> References: <cover.1666877952.git.szabolcs.nagy@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DBAEUR03FT040:EE_|AS8PR08MB9672:EE_|DBAEUR03FT050:EE_|PAWPR08MB8912:EE_ X-MS-Office365-Filtering-Correlation-Id: 00a1e51b-46b6-4e80-336e-08dab83098ce x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: HCLPDV6uwggwrEbJa/0y7n30lsugF9i7MuxMUwiUgaRE0DJKK6QCOiCt12za+Czhdh9j4ixG4MGb0XKDuk6cMj+cKeczZ37YkExmepQG776uwuOlU6cIILCDqud9pkQJdCaf8ubi1DN4Zd/0nTS+5a+/gkkeoKVWFaK0DOtUu6aJ8IMS4ka4ifvaJFi78Xd4A1DneHfthmMqHglG3RUZE174jkM9SSRmPewWN1FuR2HM7oliT7CigYFsRB01aSrAgyaBtCsuYF4E9UAfZy4bfsdlVEZWgyI6VuQ8BGMZL57IrEWW1jL743pq3PWvlNBqimGX2XvVlGeFMjne+t7f1bIOMFWfm+oJX3vqL/FsZBnL6Flv7KIKddM9KHQBZfLjpjF21GCI7rm0LpzuvcgnYxcd9VWasM2d44Ppk++xCNoupGT/F8SSxuTjkmOJIYFku4tTj4zCwI4qZtv3pU2VBgVFHtxY4YOsZyHqSMPHcKIjFBiM8eP0e/JHhTfIrbRoDnW0vsr4s2BgYKLsc5aswyOAdIf/nmw25LuyaFjjDN4vttk54BIkRUKIPYzTSvEjyUSdwW0nunDRursGh0a4dAGSOfFJZntvaDCYIesTtV4Hju6YkwhiRmNahbWSpBZvzR7NwgUDZ0+6INh8S4sC9hO06DVTCTyoye1QAijoGjGT6y4Eu1Nq0YWEKmXAuQuEQRYabbN/ERXIShVRDjIJW77WDJgjQvD/kiYztuBA+dLN3g1mAtE5/RLZyIfm7nJ5YZMSeLeb8YbjBjMv+DXDfDPRw9apArHcD7xFxzBiBsA= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(346002)(376002)(39860400002)(396003)(136003)(451199015)(36840700001)(40470700004)(46966006)(82310400005)(2616005)(316002)(83380400001)(81166007)(40480700001)(5660300002)(70206006)(8676002)(478600001)(2906002)(356005)(36756003)(44832011)(70586007)(6916009)(40460700003)(41300700001)(47076005)(186003)(426003)(8936002)(36860700001)(26005)(82740400003)(86362001)(336012)(7696005)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9672 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT050.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: a11beec6-d8eb-465c-0003-08dab8309322 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xoZpnd8X5xvVV4NcE7qv3b1wJ/Ft+LpsbfSS+O1nNkoPH4nGu3ydNxGVkW0D1HBrC6t2EeCoFAcO5RqSG7LiUqlaL0BwgTkiOwSxUbTcfx3ioAZMOeR8Kbz6tHLvfPgvdC/7XusNX+p+M5sWgtRO0Qcyt5nvHNeLKqK7ZtmS1SA41ff8iZOpn5wl5Rv3rN3Jeeuw09odAnGK6SYKxeUEc1bTZxO9aXI/z04HcnqI/ViG3TWGwgwXywzN18OlBCl5NbQpH8/08crxS9Gr7RSnTmN1SSwo0BAkqi9YMOc3EtNuVaXxLxFWE46n80XnWkmCT98ZouV8ATyA3ej5qJf2+znQugAkEKhoyUxmf9/Tnqs45PSOpQW58RhrqZEiEg6IVTcKPVr54FknL2NUmEXRulSGBCY6qDofaJv/4O/0phJVnRm1KfvKcyxcXilcVGFLLn4Pn3BRMa6oHRRYMGQ38n2gBFliCfREcU2FOaGPJCSz+0kAhmYf+Wj81L9z6MX9mIavCjwnPcaAensJL5rVWJfp3/tKZT4JHrmCXYjI/FL5qXvJHkBF1V68Yz2WLpgXT0Q7ShjEAtpoyZGZre9HMub5ypbuGSqXjXgbSSgNDnsyrgiCV0t5+7/YKtg0gPdnmufQaStB1S3hmmiZaxukoyc+sCleU2k86oZfqWis4eiPZZqnMSLVusucp82eWGLZ1fopIHqswvB8KSvEPau6Q2QD82kFgnNALRUVO2EiWhW1qiX22fVG60eSjZKunuwKEKYnoINujWkGcEVD+4w9Ew== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230022)(4636009)(396003)(376002)(346002)(136003)(39860400002)(451199015)(46966006)(40470700004)(36840700001)(82310400005)(41300700001)(5660300002)(7696005)(36756003)(44832011)(316002)(40480700001)(2906002)(8676002)(70206006)(70586007)(6916009)(8936002)(82740400003)(478600001)(426003)(83380400001)(81166007)(86362001)(26005)(47076005)(336012)(2616005)(186003)(40460700003)(36860700001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2022 15:33:28.7937 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 00a1e51b-46b6-4e80-336e-08dab83098ce X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT050.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB8912 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Szabolcs Nagy via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Szabolcs Nagy <szabolcs.nagy@arm.com> Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
patches from the morello port
|
|
Checks
Context | Check | Description |
---|---|---|
dj/TryBot-apply_patch | success | Patch applied to master at the time it was sent |
Commit Message
Szabolcs Nagy
Oct. 27, 2022, 3:33 p.m. UTC
The code assumed unsigned long can represent pointers. --- string/tester.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
Comments
On 27/10/22 12:33, Szabolcs Nagy via Libc-alpha wrote: > The code assumed unsigned long can represent pointers. LGTM, thanks. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> > --- > string/tester.c | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) > > diff --git a/string/tester.c b/string/tester.c > index eed76239f5..ba948c5723 100644 > --- a/string/tester.c > +++ b/string/tester.c > @@ -27,6 +27,7 @@ > #endif > > #include <errno.h> > +#include <stdint.h> > #include <stdio.h> > #include <stdlib.h> > #include <string.h> > @@ -529,7 +530,7 @@ test_strlen (void) > char *p; > for (i=0; i < 0x100; i++) > { > - p = (char *) ((unsigned long int)(buf + 0xff) & ~0xff) + i; > + p = (char *) ((uintptr_t)(buf + 0xff) & ~0xff) + i; > strcpy (p, "OK"); > strcpy (p+3, "BAD/WRONG"); > check (strlen (p) == 2, 4+i); > @@ -554,7 +555,7 @@ test_strnlen (void) > char buf[4096]; > for (int i = 0; i < 0x100; ++i) > { > - char *p = (char *) ((unsigned long int)(buf + 0xff) & ~0xff) + i; > + char *p = (char *) ((uintptr_t)(buf + 0xff) & ~0xff) + i; > strcpy (p, "OK"); > strcpy (p + 3, "BAD/WRONG"); > check (strnlen (p, 100) == 2, 10 + i); > @@ -582,7 +583,7 @@ test_strchr (void) > char *p; > for (i=0; i < 0x100; i++) > { > - p = (char *) ((unsigned long int) (buf + 0xff) & ~0xff) + i; > + p = (char *) ((uintptr_t) (buf + 0xff) & ~0xff) + i; > strcpy (p, "OK"); > strcpy (p+3, "BAD/WRONG"); > check (strchr (p, '/') == NULL, 9+i); > @@ -614,7 +615,7 @@ test_strchrnul (void) > char *p; > for (i=0; i < 0x100; i++) > { > - p = (char *) ((unsigned long int) (buf + 0xff) & ~0xff) + i; > + p = (char *) ((uintptr_t) (buf + 0xff) & ~0xff) + i; > strcpy (p, "OK"); > strcpy (p+3, "BAD/WRONG"); > cp = strchrnul (p, '/'); > @@ -643,7 +644,7 @@ test_rawmemchr (void) > char *p; > for (i=0; i < 0x100; i++) > { > - p = (char *) ((unsigned long int) (buf + 0xff) & ~0xff) + i; > + p = (char *) ((uintptr_t) (buf + 0xff) & ~0xff) + i; > strcpy (p, "OK"); > strcpy (p+3, "BAD/WRONG"); > check (rawmemchr (p, 'R') == p+8, 6+i); > @@ -689,7 +690,7 @@ test_strrchr (void) > char *p; > for (i=0; i < 0x100; i++) > { > - p = (char *) ((unsigned long int) (buf + 0xff) & ~0xff) + i; > + p = (char *) ((uintptr_t) (buf + 0xff) & ~0xff) + i; > strcpy (p, "OK"); > strcpy (p+3, "BAD/WRONG"); > check (strrchr (p, '/') == NULL, 9+i);
diff --git a/string/tester.c b/string/tester.c index eed76239f5..ba948c5723 100644 --- a/string/tester.c +++ b/string/tester.c @@ -27,6 +27,7 @@ #endif #include <errno.h> +#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -529,7 +530,7 @@ test_strlen (void) char *p; for (i=0; i < 0x100; i++) { - p = (char *) ((unsigned long int)(buf + 0xff) & ~0xff) + i; + p = (char *) ((uintptr_t)(buf + 0xff) & ~0xff) + i; strcpy (p, "OK"); strcpy (p+3, "BAD/WRONG"); check (strlen (p) == 2, 4+i); @@ -554,7 +555,7 @@ test_strnlen (void) char buf[4096]; for (int i = 0; i < 0x100; ++i) { - char *p = (char *) ((unsigned long int)(buf + 0xff) & ~0xff) + i; + char *p = (char *) ((uintptr_t)(buf + 0xff) & ~0xff) + i; strcpy (p, "OK"); strcpy (p + 3, "BAD/WRONG"); check (strnlen (p, 100) == 2, 10 + i); @@ -582,7 +583,7 @@ test_strchr (void) char *p; for (i=0; i < 0x100; i++) { - p = (char *) ((unsigned long int) (buf + 0xff) & ~0xff) + i; + p = (char *) ((uintptr_t) (buf + 0xff) & ~0xff) + i; strcpy (p, "OK"); strcpy (p+3, "BAD/WRONG"); check (strchr (p, '/') == NULL, 9+i); @@ -614,7 +615,7 @@ test_strchrnul (void) char *p; for (i=0; i < 0x100; i++) { - p = (char *) ((unsigned long int) (buf + 0xff) & ~0xff) + i; + p = (char *) ((uintptr_t) (buf + 0xff) & ~0xff) + i; strcpy (p, "OK"); strcpy (p+3, "BAD/WRONG"); cp = strchrnul (p, '/'); @@ -643,7 +644,7 @@ test_rawmemchr (void) char *p; for (i=0; i < 0x100; i++) { - p = (char *) ((unsigned long int) (buf + 0xff) & ~0xff) + i; + p = (char *) ((uintptr_t) (buf + 0xff) & ~0xff) + i; strcpy (p, "OK"); strcpy (p+3, "BAD/WRONG"); check (rawmemchr (p, 'R') == p+8, 6+i); @@ -689,7 +690,7 @@ test_strrchr (void) char *p; for (i=0; i < 0x100; i++) { - p = (char *) ((unsigned long int) (buf + 0xff) & ~0xff) + i; + p = (char *) ((uintptr_t) (buf + 0xff) & ~0xff) + i; strcpy (p, "OK"); strcpy (p+3, "BAD/WRONG"); check (strrchr (p, '/') == NULL, 9+i);