From unknown Mon Jun 23 07:50:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33544: gzip 1.9 alignment compile failure on cast Resent-From: "Adler, Mark" Original-Sender: "Debbugs-submit" Resent-CC: bug-gzip@gnu.org Resent-Date: Wed, 28 Nov 2018 19:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 33544 X-GNU-PR-Package: gzip X-GNU-PR-Keywords: To: 33544@debbugs.gnu.org X-Debbugs-Original-To: "bug-gzip@gnu.org" Received: via spool by submit@debbugs.gnu.org id=B.154343299025754 (code B ref -1); Wed, 28 Nov 2018 19:24:01 +0000 Received: (at submit) by debbugs.gnu.org; 28 Nov 2018 19:23:10 +0000 Received: from localhost ([127.0.0.1]:53788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gS5QU-0006hJ-Ev for submit@debbugs.gnu.org; Wed, 28 Nov 2018 14:23:10 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43003) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gS5QS-0006h6-O0 for submit@debbugs.gnu.org; Wed, 28 Nov 2018 14:23:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gS5QN-0001FF-0x for submit@debbugs.gnu.org; Wed, 28 Nov 2018 14:23:03 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: ** X-Spam-Status: No, score=2.5 required=5.0 tests=BAYES_40, RECEIVED_FROM_WINDOWS_HOST autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:44418) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gS5QM-0001F4-UY for submit@debbugs.gnu.org; Wed, 28 Nov 2018 14:23:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gS5QM-0002K6-6d for bug-gzip@gnu.org; Wed, 28 Nov 2018 14:23:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gS5QJ-0001Ac-3R for bug-gzip@gnu.org; Wed, 28 Nov 2018 14:23:02 -0500 Received: from mail-eopbgr770073.outbound.protection.outlook.com ([40.107.77.73]:19072 helo=NAM02-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gS5QI-00019j-QQ for bug-gzip@gnu.org; Wed, 28 Nov 2018 14:22:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=caltech.onmicrosoft.com; s=selector1-alumni-caltech-edu; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hUlXfy4fc7qitJ91vxmjjtkLyQMrFu49d0sjyEKY81w=; b=TwsO16kJR9otnQNIVkPuxBC6f2k+thFwgduW/DoAkY2fR1KFb16LXqmOObGxM/1E10fTq/hfmzFmOIlgIbBXqO84yadOrKNovE7RzwaJtraWajegPb1A4Qba1eSX3djOyWCQ5B9MQ8huZql6tXWwmyDfDcL3qq0HV6giVXefWlU= Received: from CY4PR03MB2695.namprd03.prod.outlook.com (10.173.43.138) by CY4PR03MB2838.namprd03.prod.outlook.com (10.175.115.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.15; Wed, 28 Nov 2018 19:22:57 +0000 Received: from CY4PR03MB2695.namprd03.prod.outlook.com ([fe80::294e:5267:33f9:5622]) by CY4PR03MB2695.namprd03.prod.outlook.com ([fe80::294e:5267:33f9:5622%8]) with mapi id 15.20.1361.019; Wed, 28 Nov 2018 19:22:56 +0000 From: "Adler, Mark" Thread-Topic: gzip 1.9 alignment compile failure on cast Thread-Index: AQHUh0/E2rM/ii/kj0aMB1qfT4sFTA== Date: Wed, 28 Nov 2018 19:22:56 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=madler@alumni.caltech.edu; x-originating-ip: [108.213.71.79] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY4PR03MB2838; 6:Wny4CBsL1NL+OyxgMVqrlQkbnt+O4mn2r++XQSG1twcgHrCFCdgwFrDOP3HwzU8H8yxi1bipA9ej83Enyt8pJT+cbszsVzUyz8X/mAxRjlaBu5xOBFnZcU3uJjV54MVUV6QXukh3OwyOSRWyEula/1OKuZoE2JbdYikTljG6naEjJRMhzqx1GB6xT128E3F3vKN+4RtvE9RlNuZedMn1WK/qwwo/rbeOrazfuzRxXMEd7YBVAx9gkpOZKUOlfjfE8Fz6g59lnPtuqMtbP0Gi/RvDcehEKCd2eE/2j4USmnpYBdv5uZ5aLUFMI5wl7mGsr6i1kjXnBcYPL9jU7n4+DceLOhGpgnl0+W7b6hR9PktZui2rPUc9TZYZkgznwE2pJitENal2cGXbd0juBt/msYXmDiE73yN7RVDErHxzuaZsAJA2p3XDCZm8cHFafVaH5eKYAlxxExBH++zG1y/+Tg==; 5:WSpHhaK/1relsOHMSc5IKgRVPgCTH1Ibo403KiJoqVVw5U2FFEfaWh8dmUTXL2NSNXm63QRNl4Y47HaL5XPtX2kYiy81UgCm37Mg71f8+QgWl14c+4vjbGXyPGkvoXhOsC6oAsPMS9NjsbRUJ7eKykIw5aQIkwbADu7VBLWCypI=; 7:AUJ8gvx1hjVE6gZ2l7tg5BqUn2bWNTpwesfRMNiJ9gTe9xXsTS7QSs8Kj+quXUcqJm8VxCV+KJAc4IsqX79/MLsP2xMLYLbXlVkBUdJpAtNOEIPjRhLq74EeELww0wx8jhv/EHm03PAa6hW9NvKdqA== x-ms-office365-filtering-correlation-id: ffbb0ee0-beef-422f-5e0f-08d65566e6f4 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:CY4PR03MB2838; x-ms-traffictypediagnostic: CY4PR03MB2838: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3231443)(999002)(944501410)(52105112)(3002001)(148016)(149066)(150057)(6041310)(20161123558120)(201703131423095)(201702281529075)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:CY4PR03MB2838; BCL:0; PCL:0; RULEID:; SRVR:CY4PR03MB2838; x-forefront-prvs: 0870212862 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(305945005)(88552002)(25786009)(186003)(71200400001)(486006)(2616005)(476003)(71190400001)(6506007)(26005)(33656002)(105586002)(68736007)(75432002)(7736002)(5660300001)(2906002)(2351001)(106356001)(256004)(97736004)(81166006)(81156014)(102836004)(2501003)(8676002)(86362001)(786003)(8936002)(478600001)(316002)(83716004)(82746002)(6116002)(14454004)(5640700003)(6486002)(3846002)(6916009)(6512007)(6436002)(99286004)(53936002)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2838; H:CY4PR03MB2695.namprd03.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: alumni.caltech.edu does not designate permitted sender hosts) x-microsoft-antispam-message-info: HKn4bcPBoXqfK1M7nHIxW0UrBayjMAf9QpEa4tdDYTHMfu0J9eREW5SbRibhs4/ghZhM1/9fopDYIik9hTAqO4jczTEJNl4cq6T0QF+awZnPLubFpiWAP+IjFvUTy84KOQ9Aot5r1TWZPOzG72RetS/Kh5/Y7frZ1mUoA1M7kZLANQ0G9gDoRW7BoEtUy3bpQFZRI/YYl5IYGc2PdJVCjqBj7me6l1/TSWPVzEnId5gY6vqp6OhnVs8NH1TcoX+ych0y0OD3WdJ/v3poZl2muCkGEVk/SoCqHrlnvk7drekWDU6uv3FL8fS6/bZB1JcyMBwBRb9TsdCy7hh2kxBYoF9em/oSncdkF50FAIwJ5gw= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: alumni.caltech.edu X-MS-Exchange-CrossTenant-Network-Message-Id: ffbb0ee0-beef-422f-5e0f-08d65566e6f4 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Nov 2018 19:22:56.8212 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: fd5be9d9-7b72-4df9-830e-b1f9cc5b44bd X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB2838 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Compiling gzip 1.9 on macOS 10.13.6 using Xcode 10.1 with clang (Apple LLVM= version 10.0.0 (clang-1000.11.45.5)), I get this error after ./configure a= nd make: memrchr.c:71:18: error: cast from 'const unsigned char *' to 'const longwor= d *' (aka 'const unsigned long *') increases required alignment from 1 to = 8 [-Werror,-Wcast-align] longword_ptr =3D (const longword *) char_ptr; I resolved it with this patch: @@ -68,7 +68,7 @@ __memrchr (void const *s, int c_in, size_t n) if (*--char_ptr =3D=3D c) return (void *) char_ptr; =20 - longword_ptr =3D (const longword *) char_ptr; + longword_ptr =3D (const void *) char_ptr; =20 /* All these elucidatory comments refer to 4-byte longwords, but the theory applies equally well to any size longwords. */ Mark From unknown Mon Jun 23 07:50:49 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: "Adler, Mark" Subject: bug#33544: closed (Re: bug#33544: gzip 1.9 alignment compile failure on cast) Message-ID: References: <1258f494-fac7-5ff2-ef9b-f458e1f51be1@cs.ucla.edu> X-Gnu-PR-Message: they-closed 33544 X-Gnu-PR-Package: gzip Reply-To: 33544@debbugs.gnu.org Date: Sat, 01 Dec 2018 00:28:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1543624082-19318-1" This is a multi-part message in MIME format... ------------=_1543624082-19318-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #33544: gzip 1.9 alignment compile failure on cast which was filed against the gzip package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 33544@debbugs.gnu.org. --=20 33544: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D33544 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1543624082-19318-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 33544-done) by debbugs.gnu.org; 1 Dec 2018 00:27:37 +0000 Received: from localhost ([127.0.0.1]:56693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gSt8B-00050s-3I for submit@debbugs.gnu.org; Fri, 30 Nov 2018 19:27:37 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:41700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gSt87-00050a-K9 for 33544-done@debbugs.gnu.org; Fri, 30 Nov 2018 19:27:33 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 59D04160527; Fri, 30 Nov 2018 16:27:25 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id r0b-HUOhtmpR; Fri, 30 Nov 2018 16:27:24 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 6F2A6160502; Fri, 30 Nov 2018 16:27:24 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id M3uxY4RffZ7f; Fri, 30 Nov 2018 16:27:24 -0800 (PST) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 48E8B16021D; Fri, 30 Nov 2018 16:27:24 -0800 (PST) Subject: Re: bug#33544: gzip 1.9 alignment compile failure on cast To: "Adler, Mark" References: From: Paul Eggert Openpgp: preference=signencrypt Autocrypt: addr=eggert@cs.ucla.edu; prefer-encrypt=mutual; keydata= xsFNBEyAcmQBEADAAyH2xoTu7ppG5D3a8FMZEon74dCvc4+q1XA2J2tBy2pwaTqfhpxxdGA9 Jj50UJ3PD4bSUEgN8tLZ0san47l5XTAFLi2456ciSl5m8sKaHlGdt9XmAAtmXqeZVIYX/UFS 96fDzf4xhEmm/y7LbYEPQdUdxu47xA5KhTYp5bltF3WYDz1Ygd7gx07Auwp7iw7eNvnoDTAl KAl8KYDZzbDNCQGEbpY3efZIvPdeI+FWQN4W+kghy+P6au6PrIIhYraeua7XDdb2LS1en3Ss mE3QjqfRqI/A2ue8JMwsvXe/WK38Ezs6x74iTaqI3AFH6ilAhDqpMnd/msSESNFt76DiO1ZK QMr9amVPknjf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s4bFhdFYnFrEieD LoGmnE2YLhdV6swJ9VNCS6pLiEohT3fm7aXm15tZOIyzMZhHRSAPblXxQ0ZSWjq8oRrcYNFx c4W1URpAkBCOYJoXvQfD5L3lqAl8TCqDUzYxhH/tJhbDdHrqHH767jaDaTB1+Talp/2AMKwc XNOdiklGxbmHVG6YGl6g8Lrbsu9NZEI4yLlHzuikthJWgz+3vZhVGyNlt+HNIoF6CjDL2omu 5cEq4RDHM44QqPk6l7O0pUvN1mT4B+S1b08RKpqm/ff015E37HNV/piIvJlxGAYz8PSfuGCB 1thMYqlmgdhd9/BabGFbGGYHA6U4/T5zqU+f6xHy1SsAQZ1MSKlLwekBIT+4/cLRGqCHjnV0 q5H/T6a7t5mPkbzSrOLSo4puj+IToNjYyYIDBWzhlA19avOa+rvUjmHtD3sFN7cXWtkGoi8b uNcby4U= Organization: UCLA Computer Science Department Message-ID: <1258f494-fac7-5ff2-ef9b-f458e1f51be1@cs.ucla.edu> Date: Fri, 30 Nov 2018 16:27:23 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------83EB73EAADFFF84FB19604A4" Content-Language: en-US X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 33544-done Cc: Gnulib bugs , 33544-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This is a multi-part message in MIME format. --------------83EB73EAADFFF84FB19604A4 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Thanks, I installed the attached patch into Gnulib. --------------83EB73EAADFFF84FB19604A4 Content-Type: text/x-patch; name="0001-memrchr-port-better-to-clang.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-memrchr-port-better-to-clang.patch" >From fff1ad350b7d1a10c136b0aa00cba9b0776cc2c7 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 30 Nov 2018 16:25:38 -0800 Subject: [PATCH] memrchr: port better to clang * lib/memrchr.c (__memrchr): Cast to void * instead of to longword *, to pacify clang -Wcast-align (Bug#33544). --- ChangeLog | 6 ++++++ lib/memrchr.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d0ccda7cc..85e987842 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2018-11-30 Paul Eggert + + memrchr: port better to clang + * lib/memrchr.c (__memrchr): Cast to void * instead of to + longword *, to pacify clang -Wcast-align (Bug#33544). + 2018-11-29 Eric Blake docs: mention printf %m considerations diff --git a/lib/memrchr.c b/lib/memrchr.c index 99acfd9c5..2efc7cb97 100644 --- a/lib/memrchr.c +++ b/lib/memrchr.c @@ -68,7 +68,7 @@ __memrchr (void const *s, int c_in, size_t n) if (*--char_ptr == c) return (void *) char_ptr; - longword_ptr = (const longword *) char_ptr; + longword_ptr = (const void *) char_ptr; /* All these elucidatory comments refer to 4-byte longwords, but the theory applies equally well to any size longwords. */ -- 2.19.2 --------------83EB73EAADFFF84FB19604A4-- ------------=_1543624082-19318-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 28 Nov 2018 19:23:10 +0000 Received: from localhost ([127.0.0.1]:53788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gS5QU-0006hJ-Ev for submit@debbugs.gnu.org; Wed, 28 Nov 2018 14:23:10 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43003) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gS5QS-0006h6-O0 for submit@debbugs.gnu.org; Wed, 28 Nov 2018 14:23:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gS5QN-0001FF-0x for submit@debbugs.gnu.org; Wed, 28 Nov 2018 14:23:03 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: ** X-Spam-Status: No, score=2.5 required=5.0 tests=BAYES_40, RECEIVED_FROM_WINDOWS_HOST autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:44418) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gS5QM-0001F4-UY for submit@debbugs.gnu.org; Wed, 28 Nov 2018 14:23:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gS5QM-0002K6-6d for bug-gzip@gnu.org; Wed, 28 Nov 2018 14:23:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gS5QJ-0001Ac-3R for bug-gzip@gnu.org; Wed, 28 Nov 2018 14:23:02 -0500 Received: from mail-eopbgr770073.outbound.protection.outlook.com ([40.107.77.73]:19072 helo=NAM02-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gS5QI-00019j-QQ for bug-gzip@gnu.org; Wed, 28 Nov 2018 14:22:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=caltech.onmicrosoft.com; s=selector1-alumni-caltech-edu; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hUlXfy4fc7qitJ91vxmjjtkLyQMrFu49d0sjyEKY81w=; b=TwsO16kJR9otnQNIVkPuxBC6f2k+thFwgduW/DoAkY2fR1KFb16LXqmOObGxM/1E10fTq/hfmzFmOIlgIbBXqO84yadOrKNovE7RzwaJtraWajegPb1A4Qba1eSX3djOyWCQ5B9MQ8huZql6tXWwmyDfDcL3qq0HV6giVXefWlU= Received: from CY4PR03MB2695.namprd03.prod.outlook.com (10.173.43.138) by CY4PR03MB2838.namprd03.prod.outlook.com (10.175.115.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.15; Wed, 28 Nov 2018 19:22:57 +0000 Received: from CY4PR03MB2695.namprd03.prod.outlook.com ([fe80::294e:5267:33f9:5622]) by CY4PR03MB2695.namprd03.prod.outlook.com ([fe80::294e:5267:33f9:5622%8]) with mapi id 15.20.1361.019; Wed, 28 Nov 2018 19:22:56 +0000 From: "Adler, Mark" To: "bug-gzip@gnu.org" Subject: gzip 1.9 alignment compile failure on cast Thread-Topic: gzip 1.9 alignment compile failure on cast Thread-Index: AQHUh0/E2rM/ii/kj0aMB1qfT4sFTA== Date: Wed, 28 Nov 2018 19:22:56 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=madler@alumni.caltech.edu; x-originating-ip: [108.213.71.79] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY4PR03MB2838; 6:Wny4CBsL1NL+OyxgMVqrlQkbnt+O4mn2r++XQSG1twcgHrCFCdgwFrDOP3HwzU8H8yxi1bipA9ej83Enyt8pJT+cbszsVzUyz8X/mAxRjlaBu5xOBFnZcU3uJjV54MVUV6QXukh3OwyOSRWyEula/1OKuZoE2JbdYikTljG6naEjJRMhzqx1GB6xT128E3F3vKN+4RtvE9RlNuZedMn1WK/qwwo/rbeOrazfuzRxXMEd7YBVAx9gkpOZKUOlfjfE8Fz6g59lnPtuqMtbP0Gi/RvDcehEKCd2eE/2j4USmnpYBdv5uZ5aLUFMI5wl7mGsr6i1kjXnBcYPL9jU7n4+DceLOhGpgnl0+W7b6hR9PktZui2rPUc9TZYZkgznwE2pJitENal2cGXbd0juBt/msYXmDiE73yN7RVDErHxzuaZsAJA2p3XDCZm8cHFafVaH5eKYAlxxExBH++zG1y/+Tg==; 5:WSpHhaK/1relsOHMSc5IKgRVPgCTH1Ibo403KiJoqVVw5U2FFEfaWh8dmUTXL2NSNXm63QRNl4Y47HaL5XPtX2kYiy81UgCm37Mg71f8+QgWl14c+4vjbGXyPGkvoXhOsC6oAsPMS9NjsbRUJ7eKykIw5aQIkwbADu7VBLWCypI=; 7:AUJ8gvx1hjVE6gZ2l7tg5BqUn2bWNTpwesfRMNiJ9gTe9xXsTS7QSs8Kj+quXUcqJm8VxCV+KJAc4IsqX79/MLsP2xMLYLbXlVkBUdJpAtNOEIPjRhLq74EeELww0wx8jhv/EHm03PAa6hW9NvKdqA== x-ms-office365-filtering-correlation-id: ffbb0ee0-beef-422f-5e0f-08d65566e6f4 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:CY4PR03MB2838; x-ms-traffictypediagnostic: CY4PR03MB2838: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3231443)(999002)(944501410)(52105112)(3002001)(148016)(149066)(150057)(6041310)(20161123558120)(201703131423095)(201702281529075)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:CY4PR03MB2838; BCL:0; PCL:0; RULEID:; SRVR:CY4PR03MB2838; x-forefront-prvs: 0870212862 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(366004)(136003)(376002)(346002)(199004)(189003)(305945005)(88552002)(25786009)(186003)(71200400001)(486006)(2616005)(476003)(71190400001)(6506007)(26005)(33656002)(105586002)(68736007)(75432002)(7736002)(5660300001)(2906002)(2351001)(106356001)(256004)(97736004)(81166006)(81156014)(102836004)(2501003)(8676002)(86362001)(786003)(8936002)(478600001)(316002)(83716004)(82746002)(6116002)(14454004)(5640700003)(6486002)(3846002)(6916009)(6512007)(6436002)(99286004)(53936002)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2838; H:CY4PR03MB2695.namprd03.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: alumni.caltech.edu does not designate permitted sender hosts) x-microsoft-antispam-message-info: HKn4bcPBoXqfK1M7nHIxW0UrBayjMAf9QpEa4tdDYTHMfu0J9eREW5SbRibhs4/ghZhM1/9fopDYIik9hTAqO4jczTEJNl4cq6T0QF+awZnPLubFpiWAP+IjFvUTy84KOQ9Aot5r1TWZPOzG72RetS/Kh5/Y7frZ1mUoA1M7kZLANQ0G9gDoRW7BoEtUy3bpQFZRI/YYl5IYGc2PdJVCjqBj7me6l1/TSWPVzEnId5gY6vqp6OhnVs8NH1TcoX+ych0y0OD3WdJ/v3poZl2muCkGEVk/SoCqHrlnvk7drekWDU6uv3FL8fS6/bZB1JcyMBwBRb9TsdCy7hh2kxBYoF9em/oSncdkF50FAIwJ5gw= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: alumni.caltech.edu X-MS-Exchange-CrossTenant-Network-Message-Id: ffbb0ee0-beef-422f-5e0f-08d65566e6f4 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Nov 2018 19:22:56.8212 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: fd5be9d9-7b72-4df9-830e-b1f9cc5b44bd X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB2838 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Compiling gzip 1.9 on macOS 10.13.6 using Xcode 10.1 with clang (Apple LLVM= version 10.0.0 (clang-1000.11.45.5)), I get this error after ./configure a= nd make: memrchr.c:71:18: error: cast from 'const unsigned char *' to 'const longwor= d *' (aka 'const unsigned long *') increases required alignment from 1 to = 8 [-Werror,-Wcast-align] longword_ptr =3D (const longword *) char_ptr; I resolved it with this patch: @@ -68,7 +68,7 @@ __memrchr (void const *s, int c_in, size_t n) if (*--char_ptr =3D=3D c) return (void *) char_ptr; =20 - longword_ptr =3D (const longword *) char_ptr; + longword_ptr =3D (const void *) char_ptr; =20 /* All these elucidatory comments refer to 4-byte longwords, but the theory applies equally well to any size longwords. */ Mark ------------=_1543624082-19318-1--